kentcdodds/old-kentcdodds.com

Issue with understanding-reacts-key-prop

a-c-sreedhar-reddy opened this issue · 1 comments

For components, this means that React will run cleanup on effects (or componentWillUnmount), then it will run state initializers (or the constructor) and effect callbacks (or componentDidMount).

But effects do not work that way. First the new Component is rendered. Then cleanup on old effects is done. Then new effects are run.

Yeah, I'll clarify that wording a bit.