Subjects

All subjects Django Java Python React Spring Boot JavaScript PHP
Sign Up Free
React 10 questions

React Basics and JSX

Understand JSX, virtual DOM rendering, render loops, initial setups, state vs props, and React components.

More React
Interview questions 1–10 of 10
1

What is React and why is it used?

React is a JavaScript library developed by Facebook for building user interfaces with reusable components. It...

Read answer →
2

What is JSX and how does it work?

JSX is a syntax extension that allows writing HTML-like code in JavaScript. It's not valid JavaScript, so it n...

Read answer →
3

What are React components? Explain functional and class components.

Components are reusable pieces of UI. React has two types: Functional Components (functions returning JSX) and...

Read answer →
4

What is Virtual DOM and why is it important?

Virtual DOM is an in-memory representation of the real DOM. React uses it to efficiently update the UI by comp...

Read answer →
5

What are Props in React? How do you pass data between components?

// Props are like function parameters // They pass data from parent to child components // Parent component f...

Read answer →
6

What is State in React? What's the difference between State and Props?

AspectStatePropsDefinitionComponent's internal dataData passed from parentMutableCan be changed with setState/...

Read answer →
7

What are React component lifecycles? Explain useEffect hook.

Lifecycle methods are special methods in React that run at certain times during a component's life. In functio...

Read answer →
8

What are different ways to do conditional rendering in React?

// 1. if-else statement function WelcomeMessage({ isLoggedIn }) { if (isLoggedIn) { return <h1>Wel...

Read answer →
9

How do you render lists in React? Why are keys important?

// Rendering lists with map() function ItemList({ items }) { return ( <ul> {items.map(...

Read answer →
10

How do you handle forms and events in React?

// Controlled component (form input with state) function LoginForm() { const [email, setEmail] = useState(...

Read answer →