Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.27 KB

File metadata and controls

27 lines (18 loc) · 1.27 KB

Reading notes for class 28 of 401

Component Lifecycle / useEffect() Hook

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

Because we can use a React Router to connect all the other components to one App.js file

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

Inside <BrowserRouter/>, outside a <Route/>.

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

Unmounts the component

What does props.children contain?

It is used to display whatever you include between the opening and closing tags when invoking a component

How do useState() and this.setState() differ?
  • useState() is used for functional components. It is a react hook and does not require the creation of a class
  • this.setState() is used to handle/change state within a react class component.

Vocab

State Hook

  • A Hook is a special function that lets you “hook into” React features.

Mounting and Un-mounting

  • The mount command mounts a storage device or filesystem, making it accessible and attaching it to an existing directory structure. The umount command "unmounts" a mounted filesystem, informing the system to complete any pending read or write operations, and safely detaching it