-
-
Notifications
You must be signed in to change notification settings - Fork 139
shallow equality check before Plotly.react #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the move from shouldComponentUpdate to componentWilUpdate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clearly I didn't read you initial comment... disregard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would including the data, layout check in shouldComponentUpdate also work?
💃
Yes but then the component wouldn't rerender the div if e.g. the style
prop changed.
This change moves the revision check out of
shouldComponentUpdate
because it's not "just an optimization" and also does a partial shallow equality check on props to skip callingPlotly.react
if nothing has changed to avoid infinite loops.