View on GitHub

reading-notes

Review, Research, and Discussion

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

because react useing Router and it’s a great way to build single-page applications because you prevent a page refresh every time a link is clicked. With client-side rendering, the page doesn’t refresh as you navigate through the different links. React Router is easy to understand, and simple to implement

If we wanted a component to show up on every page, where would we put it and why?

Inside the <BrowserRouter , outside a <Route becase we want the component to be shoen inside the brwoser but in all routes so if routes change the commponent won’t gone becasue it’s out of routes

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

when routs changing the components that belong to the rout that match with the url will be render and the other components will not be render

What does props.children contain?

it contain all the data that you pass it from the parents to the childes

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

Unlike the setState method found in class components, useState does not automatically merge update objects.

term Discripe
State Hook A Hook is a special function that lets you “hook into” React features.
Mounting and Un-Mounting “mounting” (adding nodes to the DOM), “unmounting” (removing them from the DOM),

Using the Effect Hook