Skip to the content.

Component Lifecycle / useEffect()

If you’re familiar with React class lifecycle methods, you can think of useEffect Hook as componentDidMount , componentDidUpdate , and componentWillUnmount combined


Review, Research, and Discussion

» Why do we not need more .html pages in a multi-page React app?

» If we wanted a component to show up on every page, where would we put it and why? Outside the Inside the , outside a Inside a

» What does routing do with the components that were rendered when a new route is requested

» What does props.children contain?

» How do useState() and this.setState() differ?


Document the following Vocabulary Terms

State Hook :

built in function in react that allows you to add and update states to your stateless components.

Mounting and Un-Mounting :

“mounting” (adding nodes to the DOM) or render the component, “unmounting” (removing them from the DOM) stop render or unrender the component , and “updating” (making changes to nodes already in the DOM) or edit the exist render of component.


Preparation Materials

effects hook

Tips with useEffect Hook :

- use Multiple Effects to Separate Concerns.

- In some cases, cleaning up or applying the effect after every render might create a performance problem.