What is the difference between useState and useRef?

Updated May 6, 2026

Short answer

useState triggers re-render, useRef does not.

Deep explanation

useState is reactive; useRef is mutable and persistent without UI updates.

Real-world example

useRef for DOM access, useState for UI data.

Common mistakes

  • Using useRef for UI rendering state.

Follow-up questions

  • Can useRef replace state?
  • Does useRef persist across renders?

More React Hooks interview questions

View all →