If you want to persist state across re-renders without causing any side effect, you'd use the ________ hook.

  • useContext
  • useEffect
  • useMemo
  • useRef
When you want to persist state across re-renders without causing any side effects, the useRef hook is typically used. Unlike other hooks like useEffect or useMemo, useRef does not trigger re-renders or side effects, making it ideal for maintaining mutable values that persist between renders.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *