-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Only re-render when you need to (Potentially huge perf boost) #1176
Copy link
Copy link
Closed
Labels
Description
What would you guys say to adding something like this:
shouldComponentUpdate(nextProps, nextState) {
return !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);
}which would block calling render if the props or state haven't changed. If added to components that have simple props (i.e. don't take React elements) and have simple state but have heavy render methods (like TextField)?
I see this as a potentially huge perf boost when you have a giant form with lots of TextField and you're using valueLink. That is, every keystroke of one text field causes all sibling text field's to change to do the state changing.
Thoughts?
Reactions are currently unavailable