Redux (or Flux) doesn't rely on this. Each component is notified independently (and can bail out). Parents don't know about children.
2/2: component subtree. Make sure all the children components are also 'pure'"
-
-
Let me try to explain it.. the important part is *who* calls setState.
-
Let's forget about Flux for a minute and look at vanilla React. If you call setState at the top, anything below might need a redraw.
-
Because setState can change props passed to children, which can change props of their children etc.
-
This is the case docs are talking about. sCU in any child can break the chain *started due to the (grand)parent update*.
-
With Flux/Redux there's not one update, but many. One for each connected component. So it's many setState()s at different depths.
-
sCU can only short circuit *React's* top down walk. It can't prevent Redux from telling a grandchild personally that it needs change.
-
So when your top-level reducer returns a new atom, Redux walks the entire object and calls setState on components? Surprised if so.
-
Technically Redux just calls a list of callback listeners. It's like an emitter with one event.
- 14 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.