-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Performance] Components cause re-rendering #5628
Comments
That raises an interesting question for the That's a tradeoff to take between :
react-bootstrap has made his mind on this and his not doing it.
react-bootstrap/react-bootstrap#633 (comment) I pretty much agree, I think that the Following a past discution cc @nathanmarks |
I made sure all my components don't do unnecessary re-rendering, see oreqizer/reactizer#20, so that the measurements aren't influenced by my code. All those re-renders were from Material-UI itself (from a hover action to be precise). |
I get your point. The rerendering was triggered in a deep node on the tree by a Material-UI component. |
@oliviertassinari With the current The problem is aggravated by the fact that people often have multiple Grab a popular When you account for the Toss in some I was able to fix this by wrapping I think we should benchmark this scenario using components that are better performing than the current |
I have seen it myself too. I ended up connecting each field independently to avoid the rendering of a large part of the form. That's also the pattern we use at @doctolib, but this time, with RxJS not redux. As your form grow, soon or later, pure logic won't be performant enough and you gonna have to connect lower in the tree. Still, I agree. I think that we should apply a different tradeoff with form components. |
From our experience with |
From what I can understand of the situation, the best path going forward seems to not implement any pure logic by default as it can potentially degrade the performance. Then, when users need to prune the rendering tree, they have the following tools available: |
I disagree with oliviertassinari is about the tradeoff he spoke about. |
Description
Components create new identities that cause unnecessary re-rendering (sometimes hundreds, see 2nd screenshot).
Images & references
Small example:

A lot of:

This was just the page render and a hover action.
Problem description
Creating new identities within components causes hundreds of re-renders.
Link to minimally-working code that reproduces the issue
A minimal example. Shows better when coupled with more components:
http://www.webpackbin.com/Vy-83jCbz
Versions
The text was updated successfully, but these errors were encountered: