Learn React Js MCQs

Prepare React Js MCQs (Multiple choice Questions) for exam and job interviews.

What is the purpose of React.StrictMode?

1) To enable additional checks and warnings in development mode

2) To create class components

3) To handle side effects

4) To manage state

Answer : Option 1

How do you use ReactDOM.render?

1) To render a React element into the DOM

2) To create a React element

3) To handle routing

4) To manage state

Answer : Option 1

What does useMemo hook do?

1) Memoizes expensive calculations to optimize performance

2) Creates a class component

3) Manages state

4) Handles side effects

Answer : Option 1

How do you handle forms in React?

1) Using useState and controlled components

2) Using useEffect hook

3) Using context API

4) Using React.memo

Answer : Option 1

What is the role of ReactDOM?

1) To manage rendering of React elements to the DOM

2) To handle state management

3) To perform side effects

4) To create components

Answer : Option 1

How do you handle error boundaries in React?

1) Using componentDidCatch lifecycle method or ErrorBoundary component

2) Using try-catch blocks

3) Using useEffect hook

4) Using useState hook

Answer : Option 1

What is the purpose of React.createContext?

1) To create a context object for managing global state

2) To create a new component

3) To handle side effects

4) To manage routing

Answer : Option 1

How do you use React.StrictMode?

1) To enable additional checks and warnings for components

2) To optimize performance

3) To manage state

4) To handle routing

Answer : Option 1

What is the purpose of React.memo?

1) To optimize performance by memoizing functional components

2) To manage state

3) To handle routing

4) To create a class component

Answer : Option 1

How do you handle async operations in React?

1) Using useEffect hook

2) Using useState hook

3) Using useRef hook

4) Using useCallback hook

Answer : Option 1