React Fundamentals Part 2
React Fundamentals Part 2
Source:
LIFECYCLE EVENTS
Mounting
Birth of your component
Update
Growth of your
component
Unmount
Death of your component
LIFECYCLE DIAGRAM
Source: projects.wojtekmaj.pl
RENDERING VS MOUNTING
RENDERING MOUNTING
Any time a component render "Mounting" is when React
method gets called which in turn "renders" the component for the
returns a set of instructions for first time and builds the initial
creating DOM. DOM from those instructions.
Source: reacttraining.com
componentDidMount
Source:
componentDidUpdate
Source:
componentWillUnmount
Source:
HOOKS &LifeCycle
Link
Define your navigation logic
using Link
BrowserRouter
Enclose your parent
component with
BrowserRouter
Extra Resources
&Topics
❏ Using the Effect Hook.
❏ Rules of Hooks.
❏ Building Your Own Hooks.
❏ Hooks API Reference.
❏ How to Force Re-render With Hooks in React
❏ Imperative vs Declarative Programming.
❏ The philosophy of React: Declarative rendering