小编tae*_*719的帖子

React 功能组件同时使用 React Hook 和 redux 会不会不好?

我使用 React hook 来处理局部变量,例如 const [something, setSomthing] = useState('') 和 redux 来存储使用 store 和 Provider 传递到整个组件的变量。

但有人告诉我不应该同时使用 React Hooks 和 Redux。有人可以解释为什么以及如果我不应该,我应该如何在功能组件中存储局部变量?

reactjs redux react-hooks react-functional-component

4
推荐指数
1
解决办法
1322
查看次数