reading-notes


Project maintained by Razan-am Hosted on GitHub Pages — Theme by mattgraham

Component Lifecycle / useEffect()

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?

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

What does props.children contain?

This component contains an html tag that is receiving some props and then it is displaying {props.children}.

Whenever this component is invoked {props.children} will also be displayed and this is just a reference to what is between the opening and closing tags of the component.

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


Terms


effects hook

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


References:

@By Gaurav Singhal/Pros and Cons of Client-side Routing with React

@By learn/React This Props Children

@By Logan Johnston/useState() vs setState()