React Questions

Warm up for your React interview with most asked questions and answers for junior, mid, and senior roles.

Junior

What is React?

Show Answer

React is a declarative, efficient, and flexible JavaScript library for building user interfaces or UI components.

Junior

What are props in React?

Show Answer

“Props” is a special keyword in React, which stands for properties and is being used for passing data from one component to another.

Junior

What is refs in React?

Show 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. 

Junior

What does it mean for a component to be mounted in React?

Show Answer

A component is mounted when it is added to the DOM.

Junior

What is the difference between state and props?

Show Answer

Props are immutable. State is mutable.

Junior

Can you update props in react?

Show Answer

No, you cannot update props in react. You can only update state.

Junior

What is JSX?

Show Answer

JSX is an HTML like syntax used by React and React Native that allows you to write HTML inside of JavaScript.

Junior

What are the components in React?

Show Answer

Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions

Junior

What is React Router?

Show Answer

React Router is a routing library for React. It allows you to render different components based on the URL.

Junior

How do you style React components?

Show Answer

You can style your components using CSS, but you can also use the JSX syntax to style your components.