Contents of React Interview Questions

Comprehensive collection of React interview questions and answers covering hooks, components, state management, and best practices.

What are the core principles of Redux?

Redux is built on three fundamental principles:

  1. Single Source of Truth
    The entire state of the application is stored in a single JavaScript object inside a store.
    This makes the state easy to inspect and debug.

  2. State is Read-Only
    The only way to change the state is to emit an action, an object describing what happened.
    This ensures that nothing outside of the authorized flow can directly modify the state.

  3. Changes are Made with Pure Functions
    To specify how the state tree is transformed by actions, you write pure reducers.
    A pure function means the same inputs will always produce the same outputs, without side effects, making changes predictable and testable.

These principles make Redux applications more maintainable, scalable, and predictable.