Reduce unnecesary render with gutter={[7,9]} #22474 (#22475)

This commit is contained in:
dolfje 2020-03-22 10:55:27 +01:00 committed by GitHub
parent a57760041c
commit fd0038e9e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,7 +46,7 @@ export default class Row extends React.Component<RowProps, RowState> {
this.token = ResponsiveObserve.subscribe(screens => {
const { gutter } = this.props;
if (
typeof gutter === 'object' ||
(!Array.isArray(gutter) && typeof gutter === 'object') ||
(Array.isArray(gutter) && (typeof gutter[0] === 'object' || typeof gutter[1] === 'object'))
) {
this.setState({ screens });