reading-notes


Project maintained by mr-atta Hosted on GitHub Pages — Theme by mattgraham

Component Lifecycle / useEffect() Hook


<hr>

Review, Research, and Discussion

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

Because React app consists of a single HTML file index.html. The views are coded in JSX format as components.
And when we need to build multi-page websites in React we use multiple routes instead of multiple pages to handle them.

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❓ 📁

When the router’s path and location are successfully matched, a match object is created. This object contains information about the URL and the path. This information can be accessed as properties on the match object.

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❓

setState() Class Component


useState() Functional Component

useState

useState



State Hook

Hook is a special function that lets you “hook into” React features. For example, useState is a Hook that lets you add React state to function components.

Mounting and Un-Mounting

Mounting a file system attaches that file system to a directory (mount point) and makes it available to the system. The root / file system is always mounted. Any other file system can be connected or disconnected from the root / file system. These files are not permanently affected by the mounting process, and they become available again when the file system is Un-Mounting.



effects hook 📂

The Effect Hook lets you perform side effects in function components.

The function passed to useEffect will run after the render is committed to the screen.

By default, effects run after every completed render, but you can choose to fire them only when certain values have changed.

📁 effects hook