Themr breaks shouldComponentUpdate shallow equal optimization
See original GitHub issueThemr breaks shouldComponentUpdate shallow equal optimization.
Every new render themr returns a new object reference for theme object, so all subsequent optimizations based on shallowEqual
like pure
recompose enhancer always returns true.
As nextProps.theme !== props.theme
.
I’ll create a PR to fix.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (14 by maintainers)
Top Results From Across the Web
Optimizing React.js Performance with PureComponents and ...
In the case of PureComponents, the shouldComponentUpdate method does a shallow comparison of that component's state and props to determine ...
Read more >How to implement shouldComponentUpdate with this.context?
Basically, if I move a context-dependant component anywhere inside a PureRenderMixin -enabled component, it will break but very subtly.
Read more >Shallow Compare - React
shallowCompare performs a shallow equality check on the current props and nextProps objects as well as the current state and nextState objects. It...
Read more >Writing efficient React code - Firefox Source Docs - Mozilla
As a start let's discuss about how React renders normal plain components, that don't use shouldComponentUpdate . What we call plain components here...
Read more >Large Dynamically Generated Forms in React — Part 2
Step 1 — Break into smaller components. Independent of our goal of optimizing our forms, it is good practice to separate components into...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you @istarkov and @raveclassic, beautiful conversation 😄 I’m merging 👍 there are no breaking changes and I agree that updating context should not be solved in here. I’m also releasing a patch
@istarkov Ahh makes sense now, sorry, didn’t notice. At last we need to wait @javivelasco to take a look.