Open happytuna75 opened 5 years ago
@happytuna75 thanks for advice! I thinks its great feature. I will implement it later, or if you want to help - PR wellcome=) My suggestion to use https://github.com/dashed/shallowequal
I'm very happy to volunteer :) You'll see my pull request soon...
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