You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JsonEditor.prototype.shouldComponentUpdate = function shouldComponentUpdate(_ref2) { var htmlElementProps = _ref2.htmlElementProps; return htmlElementProps !== this.props.htmlElementProps; };
In this function you compare with !== the new (yet to be applied) and the old (current) htmlElementProps.
In the docs you specify * @property {object} [htmlElementProps] - html element custom props
but if htmlElementProps is an object than the comparison above will always return true, since you are comparing two distinct objects and for example, '{a: 1} !== {a: 1}' gives true.
Shouldn't you have a shallow comparison here? like suggested in https://reactjs.org/docs/shallow-compare.html and in particular
The text was updated successfully, but these errors were encountered:
JsonEditor.prototype.shouldComponentUpdate = function shouldComponentUpdate(_ref2) { var htmlElementProps = _ref2.htmlElementProps; return htmlElementProps !== this.props.htmlElementProps; };
In this function you compare with !== the new (yet to be applied) and the old (current) htmlElementProps.
In the docs you specify
* @property {object} [htmlElementProps] - html element custom props
but if

htmlElementProps
is an object than the comparison above will always return true, since you are comparing two distinct objects and for example, '{a: 1} !== {a: 1}' gives true.Shouldn't you have a shallow comparison here? like suggested in https://reactjs.org/docs/shallow-compare.html and in particular
The text was updated successfully, but these errors were encountered: