React Fundamentals : What Causes a React Component to Re-Render

Опубликовано: 05 Ноябрь 2024
на канале: Nsquared Coding
7,303
129

In this video, I will go over what causes a react component to re-render.
The base reason a component re-renders is because the props that a component receives get updated.
I will go over several examples showing why how different component structures work and can get re-rendered.

When a component gets re-rendered, it doesn't mean the dom will get updated. First the virtual dom gets updated and react will compare the virtual dom against the actual dom to see if changes need to be made.

Github Repo:
https://github.com/npatel023/react-re...

0:30 Intro
1:00 Example 1 - Input Component
1:48 Example 2 - Form Component
5:02 Example 3 - Key prop
7:04 Example 4 - Context Provider
12:45 Outro