These are my reading notes for Code Fellows
The second param is an array of variables that the component will check to make sure changed before re-rendering. You could put whatever bits of props and state you want in here to check against. Or, put nothing… That will ensure the useEffect only runs once.
Yes
No
…a Hook that lets you add React state to function components. (source)
Initialization > mounting > updating > unmounting
Initialization: “This is the stage where the component is constructed with the given Props and default state. This is done in the constructor of a Component Class.”
Mounting: “Mounting is the stage of rendering the JSX returned by the render method itself.”
Updating: “Updating is the stage when the state of a component is updated and the application is repainted.”
Unmounting: “As the name suggests Unmounting is the final step of the component lifecycle where the component is removed from the page.”