React JS MCQs with answers Page - 20

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 • 832.27K Points
Coach

Q. Which lifecycle method is deprecated in React 17?

  • (A) componentDidMount
  • (B) componentWillMount
  • (C) componentDidUpdate
  • (D) componentWillUnmount

A

Admin • 832.27K Points
Coach

Q. Which tool helps to inspect React component hierarchies in browser?

  • (A) Redux DevTools
  • (B) React Developer Tools
  • (C) Chrome DevTools
  • (D) React Profiler

A

Admin • 832.27K Points
Coach

Q. What is JSX transpiled to?

  • (A) HTML strings
  • (B) JavaScript function calls
  • (C) CSS classes
  • (D) React Components

A

Admin • 832.27K Points
Coach

Q. How do you pass data from a child component to a parent component?

  • (A) Using props
  • (B) Using callback functions passed as props
  • (C) Using useState hook in child
  • (D) Using componentDidMount

A

Admin • 832.27K Points
Coach

Q. What is the recommended way to handle forms in React?

  • (A) Using controlled components
  • (B) Using uncontrolled components only
  • (C) Using direct DOM manipulation
  • (D) Not recommended to handle forms

A

Admin • 832.27K Points
Coach

Q. What happens if a component returns null?

  • (A) Nothing is rendered
  • (B) An error occurs
  • (C) An empty div is rendered
  • (D) The component re-renders infinitely

A

Admin • 832.27K Points
Coach

Q. Which of these is NOT a feature of React?

  • (A) Component-based architecture
  • (B) Two-way data binding
  • (C) Virtual DOM
  • (D) JSX syntax

A

Admin • 832.27K Points
Coach

Q. What is the primary purpose of the React key prop?

  • (A) To uniquely identify elements in a list for efficient re-rendering
  • (B) To add CSS styles
  • (C) To bind event handlers
  • (D) To pass data to child components

A

Admin • 832.27K Points
Coach

Q. What hook would you use to perform side effects in functional components?

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

A

Admin • 832.27K Points
Coach

Q. Which of the following is true about React Context API?

  • (A) It provides a way to pass data through the component tree without passing props manually at every level
  • (B) It replaces Redux
  • (C) It is used for styling components
  • (D) It only works with class components

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ