- What is the main purpose of useRef in React?
 - useRefis primarily used to create references that persist across renders without causing re-renders.
 
- Can useRef update state in React?
 No,- useRefdoes not trigger re-renders when its value changes, unlike- useState.
 
- When should I use useRef instead of useState?
 Use- useRefwhen a value needs to persist across renders but does not require triggering a re-render.
 
- How is useRef different from useEffect?
 - useEffectis used for handling side effects, while- useRefis for storing references that persist between renders.
 
- Can useRef be used to store values across renders?
 Yes,- useRefcan store values across renders without causing re-renders.
 
- Can useRef be used in functional components?
 Yes,- useRefis specifically designed for use in functional components.
 
- Is useRef similar to useState?
 Not exactly. useState triggers re-renders when updated, whereas- useRefdoes not.
 
- Does useRef work with event listeners?
 Yes,- useRefcan store references to elements and be used in event listeners without causing re-renders.
 
- Can I use useRef for API calls?
 Yes,- useRefcan be used to store API response data without triggering re-renders.
 
- Is useRef better than useState?
 It depends on the use case. If you need reactivity,- useStateis better. If you need a persistent value without re-renders,- useRefis ideal.