Explain the role of reducer?



Explain the role of reducer?..

Answer / Sachin Rastogi

A Reducer in React.js is a pure function that takes the current state and an action, and returns a new state based on the provided action. It plays a vital role in managing application's state when using Redux or Context API.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More React.js Interview Questions

What are controlled components?

1 Answers  


Explain lifecycle of a react component?

1 Answers  


List down the components of redux?

1 Answers  


What is a state in react?

1 Answers  


Name two types of React component?

1 Answers  


What is the significance of keys in react?

1 Answers  


What is function based component?

1 Answers  


Is setState() is async? Why is setState() in React Async instead of Sync?

1 Answers  


List down some of the methods in a react-dom package

1 Answers  


What are components in reactjs? Explain the component lifecycle with the help of a diagram explaining each component method in detail. Also, give an example of both stateless and stateful components with source code?

1 Answers  


State the main difference between Pros and State?

1 Answers  


What do you understand by virtual dom? Explain its working.

1 Answers  


Categories