- Understanding about react hook (synchronization instead of lifeycle)
- What is
useRef
? - Why we need
useRef
?- persist value on every render (mutable state)
- want to store value without notifying react to rerender
- Use cases of
useRef
?- store DOM to access methods like input
focus
- store handler or callback
- store DOM to access methods like input
- Email subscribe form
- Previous state
- Interval hook
- Event listener