React Flashcards

1
Q

What is React?

A

React is a JavaScript library for building user interfaces, primarily using components to manage the UI efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is JSX?

A

JSX is a syntax extension for JavaScript that allows you to write HTML-like code within JavaScript files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a React Component?

A

A React component is a reusable piece of UI, defined as either a function or a class, that returns JSX.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are props in React?

A

Props (short for properties) are immutable inputs passed from parent to child components to configure or display data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is state in React?

A

State is a mutable object managed within a component to track dynamic data or UI changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Virtual DOM?

A

The Virtual DOM is a lightweight representation of the real DOM that React uses to optimize UI updates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is useState in React?

A

useState is a React Hook that lets you add state to functional components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is useEffect in React?

A

useEffect is a React Hook for handling side effects like data fetching, subscriptions, or DOM updates in functional components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is React’s key attribute?

A

The key attribute helps React identify which items have changed, are added, or are removed, optimizing list rendering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between controlled and uncontrolled components?

A

Controlled components are managed by React state, while uncontrolled components rely on the DOM for their state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly