#reactjs
Ref and State have something in common. Understanding that is the key to easily remember differences between them ;)
Inspiration from React docs: https://react.dev/learn/referencing-v...
⏱️Timestamps:
00:00 - Introduction
00:40 - State vs Local Variable
01:25 - Ref and State - Common Part
01:51 - useCustomRef implementation
02:19 - Comparing useRef vs useCustomRef
02:38 - Visualization of differences between Ref and State
03:26 - #1 Rule of using Refs
03:49 - #2 Rule of using Refs
05:14 - One sentence summary