9 React Interview Questions

Last updated on 10 Aug, 2022

Here is a list of React interview questions to prepare for job interviews.

Basics

0
Is it possible to write a React application without JSX?
0
When we setup a React project, always we import two libraries,react and react-dom.
import React from "react"; 
import ReactDOM from "react-dom";

If those two are used together always, why they are kept as two separate files?

0
When I ran my React project, I am seeing this error in the browser console:
Warning: Each child in a list should have a unique "key" prop.

What might have happened?

0
What is JSX? and why do we use it in React project?
0

Here is a JSX code snippet:

<div>
  <h1>Hello JSX</h1>
  <h2 label="screen">Sub heading</h2>
</div>

Can you please write down JavaScript equivalent of this code?

Context API

0
When is it ideal to use Context API in React?

Tools

0
For a React project, will you choose Webpack or Parcel?
0
You are going to initialize your React project as a Git repository. What all files or folders you usually add to your .gitignore file?
0
Which of the following `import` techniques is better for performance and why?
// Method 1
import Lodash from "lodash";
// Method 2
import { capitalize } from "lodash";