React Flashcards

1
Q

What are components in React?

A

The building blocks of a React application. Components can be either class components or functional components (the latter are more common now with the introduction of hooks).

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

What is JSX?

A

A syntax extension that allows you to write HTML-like code within JavaScript. It makes it easy to create React elements.

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

What are props in React?

A

Short for ‘properties,’ these are used to pass data from parent components to child components. Props are read-only and help in making components reusable.

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

What is state in React?

A

A component’s internal data that can change over time. State is managed within a component and can affect how the component renders.

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

What are lifecycle methods in React?

A

Special methods in class components that allow you to run code at specific points in a component’s life (e.g., when it mounts, updates, or unmounts). With functional components, you can achieve similar behavior using the useEffect hook.

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

What are hooks in React?

A

Functions that let you use state and other React features in functional components. Common hooks include useState for state management and useEffect for side effects.

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

What is conditional rendering in React?

A

A technique to render different UI elements based on certain conditions, often using JavaScript expressions within JSX.

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

How do you render lists in React?

A

You can render lists of elements in React using the .map() method. Each element in a list should have a unique ‘key’ prop to help React identify and manage changes efficiently.

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

What is a store in Redux?

A

A centralized repository that holds the application’s state. There’s only one store in a Redux application.

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

What are actions in Redux?

A

Plain JavaScript objects that describe what happened in the application. An action must have a type property, and it can also have additional data (payload).

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

What are reducers in Redux?

A

Pure functions that take the current state and an action, and return a new state. They specify how the state changes in response to actions.

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

What is dispatch in Redux?

A

A method used to send actions to the store. When an action is dispatched, it triggers the reducer to update the state.

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

What are selectors in Redux?

A

Functions that extract specific pieces of data from the Redux store. They help in accessing the state more efficiently.

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

What is middleware in Redux?

A

Functions that provide a way to extend Redux’s abilities, often used for logging, handling asynchronous actions, or performing side effects.

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

What is a provider in Redux?

A

A component that makes the Redux store available to the rest of your app. It wraps the main application component.

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

How do you connect components to Redux?

A

You can connect React components to the Redux store using the connect function or the useSelector and useDispatch hooks in functional components.