AceDevHub
Beginner React Interview QuestionsBeginnerConcept

React · Question 25

What are Hooks in React?

Direct answer

Hooks are React functions that let function components use features such as state, context, refs, effects, and reusable stateful logic.

  • useState: component state.
  • useEffect: synchronization with external systems.
  • useRef: mutable values or DOM references that do not trigger rendering.
  • useContext: reads and subscribes to a context value.

Custom Hooks let you combine built-in Hooks into reusable logic. Their names conventionally begin with use.