React JS Interview Questions

Maybe it will help you for your career

Table of contents

No heading

No headings in the article.

  • What is React?
  • What are the major features of React?
  • What is JSX?
  • What is the difference between Element and Component?
  • How to create components in React?
  • When to use a Class Component over a Function Component?
  • What are Pure Components?
  • What is state in React?
  • What are props in React?
  • What is the difference between state and props?
  • Why should we not update the state directly?
  • What is the purpose of callback function as an argument of setState()?
  • What is the difference between HTML and React event handling?
  • How to bind methods or event handlers in JSX callbacks?
  • How to pass a parameter to an event handler or callback?
  • What are synthetic events in React?
  • What are inline conditional expressions?
  • What is "key" prop and what is the benefit of using it in arrays of elements?
  • What is the use of refs?
  • How to create refs?
  • What are forward refs?
  • Which is preferred option with in callback refs and findDOMNode()?
  • Why are String Refs legacy?
  • What is Virtual DOM?
  • How Virtual DOM works?
  • What is the difference between Shadow DOM and Virtual DOM?
  • What is React Fiber?
  • What is the main goal of React Fiber?
  • What are controlled components?
  • What are uncontrolled components?
  • What is the difference between createElement and cloneElement?
  • What is Lifting State Up in React?
  • What are the different phases of component lifecycle?
  • What are the lifecycle methods of React?
  • What are Higher-Order components?
  • How to create props proxy for HOC component?
  • What is context?
  • What is children prop?
  • How to write comments in React?
  • What is the purpose of using super constructor with props argument?
  • What is reconciliation?
  • How to set state with a dynamic key name?
  • What would be the common mistake of function being called every time the component renders?
  • Is lazy function supports named exports?
  • Why React uses className over class attribute?
  • What are fragments?
  • Why fragments are better than container divs?
  • What are portals in React?
  • What are stateless components?
  • What are stateful components?
  • How to apply validation on props in React?
  • What are the advantages of React?
  • What are the limitations of React?
  • What are error boundaries in React v16
  • How error boundaries handled in React v15?
  • What are the recommended ways for static type checking?
  • What is the use of react-dom package?
  • What is the purpose of render method of react-dom?
  • What is ReactDOMServer?
  • How to use InnerHtml in React?
  • How to use styles in React?
  • How events are different in React?
  • What will happen if you use setState in constructor?
  • What is the impact of indexes as keys?
  • Is it good to use setState() in componentWillMount() method?
  • What will happen if you use props in initial state?
  • How do you conditionally render components?
  • Why we need to be careful when spreading props on DOM elements??
  • How you use decorators in React?
  • How do you memoize a component?
  • How you implement Server-Side Rendering or SSR?
  • How to enable production mode in React?
  • What is CRA and its benefits?
  • What is the lifecycle methods order in mounting?
  • What are the lifecycle methods going to be deprecated in React v16?
  • What is the purpose of getDerivedStateFromProps() lifecycle method?
  • What is the purpose of getSnapshotBeforeUpdate() lifecycle method?
  • Do Hooks replace render props and higher order components?
  • What is the recommended way for naming components?
  • What is the recommended ordering of methods in component class?
  • What is a switching component?
  • Why we need to pass a function to setState()?
  • What is strict mode in React?
  • What are React Mixins?
  • Why is isMounted() an anti-pattern and what is the proper solution?
  • What are the Pointer Events supported in React?
  • Why should component names start with capital letter?
  • Are custom DOM attributes supported in React v16?
  • What is the difference between constructor and getInitialState?
  • Can you force a component to re-render without calling setState?
  • What is the difference between super() and super(props) in React using ES6 classes?
  • How to loop inside JSX?
  • How do you access props in attribute quotes?
  • What is React PropType array with shape?
  • How to conditionally apply class attributes?
  • What is the difference between React and ReactDOM?
  • Why ReactDOM is separated from React?
  • How to use React label element?
  • How to combine multiple inline style objects?
  • How to re-render the view when the browser is resized?

Disclaimer : This content may be copyrighted because I have written this blog by searching internet and talking to experienced persons.