React Questions
Warm up for your React interview with most asked questions and answers for junior, mid, and senior roles.
What is React?
Show AnswerHide Answer
React is a declarative, efficient, and flexible JavaScript library for building user interfaces or UI components.
What are props in React?
Show AnswerHide Answer
“Props” is a special keyword in React, which stands for properties and is being used for passing data from one component to another.
What is refs in React?
Show AnswerHide Answer
Refs are a function provided by React to access the DOM element and the React element that you might have created on your own.
What does it mean for a component to be mounted in React?
Show AnswerHide Answer
A component is mounted when it is added to the DOM.
What is the difference between state and props?
Show AnswerHide Answer
Props are immutable. State is mutable.
Can you update props in react?
Show AnswerHide Answer
No, you cannot update props in react. You can only update state.
What is JSX?
Show AnswerHide Answer
JSX is an HTML like syntax used by React and React Native that allows you to write HTML inside of JavaScript.
What are the components in React?
Show AnswerHide Answer
Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions
What is React Router?
Show AnswerHide Answer
React Router is a routing library for React. It allows you to render different components based on the URL.
How do you style React components?
Show AnswerHide Answer
You can style your components using CSS, but you can also use the JSX syntax to style your components.