- Topics:
- Hooks (in a nutshell):
- Functions that start with use*
- Can be used (executed) ONLY WITHIN Components OR custom Hooks
- Were created to give the same power to Functional Components (as Class-based Components)
- React Component Lifecycle
- Study the diagram of the Lifecycle
- Study Render & Commit from the docs.
useEffect()
- Study: useEffect @ react.dev
- Study: React.Fragments
- Hooks (in a nutshell):
Further study & practice:
-
Study:
useLayoutEffect()
-
Practice: see if you can use one of these APIs to fetch some book data using
useEffect
and display them in your Book React app.
-
React rules:
- When a Component renders, all nested Components are also rendered.
- React compares previous state with current (new) state and re-renders only when they are different.
-
- Sample JSON endpoint:
https://jsonplaceholder.typicode.com/todos/1
- Sample JSON endpoint with delay:
https://jsonplaceholder.typicode.com/todos/1?_delay=5000
- Sample JSON endpoint:
-
- Just add water:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
- Just add water: