Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 530 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 530 Bytes

React useRef Examples

📹 Live topics

  • 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

Examples

  • Email subscribe form
  • Previous state
  • Interval hook
  • Event listener