React JS MCQs with answers Page - 3

Here, you will find a collection of MCQ questions on React JS. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833K Points
Coach

Q. Which of these is a valid way to pass props to a component?

Code:
<MyComponent title="React" />
  • (A) title: 'React'
  • (B) MyComponent.props('React')
  • (C) <MyComponent title="React" />
  • (D) MyComponent[title='React']

A

Admin • 833K Points
Coach

Q. Which React hook is best suited for managing complex state logic?

  • (A) useState
  • (B) useReducer
  • (C) useEffect
  • (D) useCallback

A

Admin • 833K Points
Coach

Q. Which of the following correctly describes React's data flow?

  • (A) Two-way binding
  • (B) Circular flow
  • (C) Unidirectional flow
  • (D) Bidirectional flow

A

Admin • 833K Points
Coach

Q. Which statement about props is correct?

  • (A) Props are mutable
  • (B) Props can only be passed to class components
  • (C) Props help pass data to components
  • (D) Props are used to store state

A

Admin • 833K Points
Coach

Q. What is the use of Fragment in React?

  • (A) To apply CSS styling
  • (B) To manage routing
  • (C) To wrap multiple elements without adding extra nodes to the DOM
  • (D) To format JSON data

A

Admin • 833K Points
Coach

Q. What does the useMemo hook do?

  • (A) Returns a memoized callback
  • (B) Returns a memoized value
  • (C) Returns a cleanup function
  • (D) Returns a component

A

Admin • 833K Points
Coach

Q. Which hook should be used to avoid re-creating functions on every render?

  • (A) useState
  • (B) useEffect
  • (C) useCallback
  • (D) useMemo

A

Admin • 833K Points
Coach

Q. In which file is the root React component typically rendered?

  • (A) App.js
  • (B) Main.js
  • (C) Index.js
  • (D) Root.js

A

Admin • 833K Points
Coach

Q. What does React.StrictMode do?

  • (A) Disables JSX
  • (B) Checks for potential problems in code
  • (C) Blocks state updates
  • (D) Optimizes rendering

A

Admin • 833K Points
Coach

Q. Which method is used to update state in a class component?

  • (A) this.state
  • (B) setState
  • (C) updateState
  • (D) changeState