最佳答案
不,reducer 或 Redux 不是必需的。 Vanilla React 工作正常,或者其他选项,例如MobX。
查看 Redux FAQ :
Dan Abramov, one of the creators of Redux, says:
...don’t use Redux until you have problems with vanilla React.
何时使用 Redux 是一种架构意见,常见问题解答提供了以下指南:
In general, use Redux when you have reasonable amounts of data changing over time, you need a single source of truth, and you find that approaches like keeping everything in a top-level React component’s state are no longer sufficient.
关于state - 终极版 : Is it necessary?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37619223/