kitta
kitta

Reputation: 2069

Redux saga, How to listen to an action from component

In Redux, Component will render by using props from reducers.

But what I saw is there are many cases easier just using setState. Not all the component's state should be in the reducer else its introduced reducer complexity.

So here it's come to question.

How can I listen to an action then setState of the component? Just like take in Saga.

Upvotes: 1

Views: 654

Answers (1)

Alp
Alp

Reputation: 29739

There is no simple answer to this. Basically you are exploring possibilities to handle redux actions and its store per component.

Quote from the official documentation:

There are a number of community packages that implement various approaches for storing per-component state in a Redux store instead, such as redux-ui, redux-component, redux-react-local, and more.

These are links to the mentioned libraries:

There is also KeaJS and worth a look: https://kea.js.org/

Upvotes: 1

Related Questions