0 votes
in ReactJS by

Can I dispatch an action in reducer?

1 Answer

0 votes
by

Dispatching an action within a reducer is an anti-pattern. Your reducer should be without side effects, simply digesting the action payload and returning a new state object. Adding listeners and dispatching actions within the reducer can lead to chained actions and other side effects.

Related questions

0 votes
0 votes
asked Dec 14, 2023 in ReactJS by rahuljain1
0 votes
asked Jun 21, 2023 in Hadoop by sharadyadav1986
...