Do intermediate components fire hooks?
-
-
I think the core of what I'm trying to say is that Flux/Redux circumvent React natural top down data flow, opting for many entry points
1 reply 0 retweets 4 likes -
Replying to @dan_abramov @wycats and
On Redux/Flux change event, each subscribed component independently tells React "I need an update". React remembers that.
1 reply 0 retweets 2 likes -
Replying to @dan_abramov @wycats and
Then React reconciles from each of these entry points the normal way. So yes, lifecyles on intermediate components fire.
1 reply 0 retweets 0 likes -
Replying to @dan_abramov @wycats and
But even if sCU of a parent says "don't update me" React will still look at subscribe children because they independently asked for update.
2 replies 0 retweets 4 likes -
Has this changed or were people very confused before:https://www.bennadel.com/blog/2904-shouldcomponentupdate-will-short-circuit-an-entire-subtree-of-components-in-reactjs.htm …
2 replies 2 retweets 0 likes -
Replying to @wycats @dan_abramov and
1: For example the React docs also say: "Furthermore, React.PureComponent's shouldComponentUpdate() skips prop updates for the whole
1 reply 0 retweets 0 likes -
Replying to @wycats @dan_abramov and
2/2: component subtree. Make sure all the children components are also 'pure'"
1 reply 0 retweets 0 likes -
Let me try to explain it.. the important part is *who* calls setState.
2 replies 0 retweets 1 like -
I understand what you're saying: if a child component calls setState on itself, React will invoke it even if its ancestor sCU'ed false
1 reply 0 retweets 1 like
I'm trying to understand if that was always the case or is new behavior. If it always existed, the PureComponent docs seem wrong.
-
-
Replying to @wycats @dan_abramov and
Always. .setState was sync; if called on parent and child (w/ sCU=1), child updated 2x. v0.4 added batching which fixes; no sCU changes tho.
1 reply 1 retweet 5 likes - 1 more reply
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.