React Component Lifecycle
This was something I had learned before, but was struggling to really memorize so I thought I’d blog about it.
React Lifecycle Methods diagram
Fully interactive and accessible React Lifecycle Methods diagram.
I was just confused about when render would fire. As you can tell from the diagram, render fires before componentDidUpdate and componentDidMount.
Render also fires when passed new props or the state is set again. This diagram is pretty helpful for me to understand when render is fired, so I know what to put in there. forceUpdate is something I heard I should not use unless absolutely necessary, which is basically almost never.
That’s all for this week! Stay safe, maintain social distancing, wear a mask and wash your hands often!