react-lifecycle-methods-diagram icon indicating copy to clipboard operation
react-lifecycle-methods-diagram copied to clipboard

Missing componentDidCatch

Open simonguo opened this issue 6 years ago • 5 comments

simonguo avatar Aug 29 '18 03:08 simonguo

And also getDerivedStateFromError will be available in v 16.6.

dance2die avatar Oct 08 '18 21:10 dance2die

Both are available now, any chance of getting the diagram updated?

AndrewCraswell avatar Apr 27 '19 17:04 AndrewCraswell

Both componentDidCatch and getDerivedStateFromError are kinda "on the side" of component lifecycle. Could be listed somewhere next to the chart, but I don't think they belong to any place on the actual chart.

wojtekmaj avatar May 03 '19 10:05 wojtekmaj

@wojtekmaj Actually I think they does belong to 'less common lifecycles'. IMO one of the goals of this diagram is to help people understand the execution sequence of lifecycle methods. At some point, we would wonder when componentDidCatch and getDerivedStateFromError are executed.

hudidit avatar May 09 '19 03:05 hudidit

At some point, we would wonder when componentDidCatch and getDerivedStateFromError are executed.

Hopefully, we wonder first, then implement. ;) While Brian Vaughn has explained those methods in depth here, this diagram is great at illustrating what he describes and so I think it would be helpful to also have these two in there.

s-h-a-d-o-w avatar Jun 23 '19 13:06 s-h-a-d-o-w