React Flashcards

1
Q

What is in React 18?

A
  • Root API
  • Automatic batching
  • Concurrent rendering (useTransition and useDeferredValue)
  • Suspense feature
  • New hooks
    • useId
    • useTransition
    • useDeferredValue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the key features of React?

A
  • Component-Based: React allows you to build encapsulated components that manage their state.
  • Virtual DOM: React uses a virtual DOM to efficiently update the UI by only rendering the necessary components that have changed.
  • JSX: JSX is a syntax extension that allows you to write HTML-like code within JavaScript, making it easier to define React components.
  • One-Way Data Binding: React follows a unidirectional data flow, which means data flows from parent to child components to maintain a predictable state.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are React hooks?

A

React hooks are functions that let you use state and enable functional components to have state and lifecycle features previously available only in class components.

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

What is Virtual DOM?

A

The Virtual DOM (VDOM) is an in-memory representation of Real DOM. The representation of a UI is kept in memory and synced with the “real” DOM. It’s a step that happens between the render function being called and the displaying of elements on the screen. This entire process is called reconciliation.

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

What is Redux?

A

Redux is a state container for JavaScript applications, commonly used with libraries like React or Angular for managing application state in a more organized and predictable way.

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

What are key concepts in Redux?

A
  1. Single Source of Truth:
    • Redux stores the entire state of your application in a single immutable object tree (known as the “state” or “store”).
    • This single source of truth makes it easier to manage and debug application state.
  2. State is Read-Only:
    • The state in Redux is immutable and cannot be changed directly.
    • To update the state, you dispatch actions that describe the change you want to make.
  3. Changes are Made with Pure Functions:
    • Redux uses pure reducer functions to specify how the application’s state changes in response to actions.
    • Reducer functions take the previous state and an action as arguments and return the new state.
  4. Unidirectional Data Flow:
    • Actions are dispatched to the Redux store, where they are processed by reducers to update the state.
    • Components can subscribe to changes in the state and re-render based on updated data.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why use Redux?

A
  • Predictable State Management
  • Single Source of Truth
  • Unidirectional Data Flow
  • Maintainability and Scalability
  • Time Travel Debugging
  • Integration with Middleware
  • Ecosystem and Community Support
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Redux-Saga?

A

A middleware library for Redux that helps manage side effects (such as asynchronous tasks like data fetching and impure operations) in a Redux application

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