Why were Hooks introduced in React?
Hooks were introduced to let developers use state and lifecycle features in functional components, reduce complexity of class components, and make logic reuse easier.
Practice exam-ready one liner questions for Interview Practice with quick answers for SSC, Railway, Banking and competitive exams.
Total Questions: 54
Hooks were introduced to let developers use state and lifecycle features in functional components, reduce complexity of class components, and make logic reuse easier.
Hooks solve problems such as complex class component logic, difficulty in reusing stateful logic, and confusion around this keyword in JavaScript.
Hooks must only be called at the top level of a React function and only inside React function components or custom Hooks. They should not be called inside loops, conditions, or nested functions.
Hooks allow functional components to manage state and side effects, while class components use this.state and lifecycle methods. Hooks usually make code shorter, cleaner, and easier to reuse.
A custom Hook is a JavaScript function whose name starts with use and which can call other Hooks. It is used to extract and reuse stateful logic across multiple components.
No, Hooks cannot be used inside class components. They are designed only for function components and custom Hooks.
useState is used to add and manage local state in a functional component. It returns the current state value and a function to update it.
useContext is used to read and use context values directly inside a functional component, helping avoid prop drilling.
Hooks make code more readable, reduce class-related complexity, allow logic reuse through custom Hooks, and help organize state and side effects in a cleaner way.
useState is used to add and manage state in functional components.
Copyright 2026 Exambodh - aptitude, reasoning & verbal practice.