2 ms·
> Does it really? It doesn't. Updating state in a component triggers the re-rendering of all its children. This is what they are referring to. You can stop tha
by mikojan 4y ago
> Does it really?
It doesn't. Updating state in a component triggers the re-rendering of all its children. This is what they are referring to. You can stop that propagating effect as usual by wrapping direct descendants in React.memo().
Be aware, that an anonymous list of components will show up as "re-rendering" in the browser tools. You can verify that this is not(!) the case by looking at the profiler instead.
Additionally, if you cannot tolerate even just one component re-rendering, you can simply use React.useSynExternalStore() instead of Context.