这是我的 Songs.js
class Songs extends React.Component {
render() {
return (
<div>
Song List
</div>
);
}
}
export default connect()(Songs);
App.js
const App = () => {
return <div>
<Songs/>
</div>
};
export default App;
Index.js
ReactDOM.render(
<Provider store={createStore(reducers)}>
<App />
</Provider>,
document.getElementById("root"))
我正在尝试学习 React Redux。
在 Songs.js 文件中,我仅在使用连接时收到无效 Hooks 错误。当我不尝试使用 redux connect 时,该应用程序运行良好
最佳答案
仅供引用,我能够复制并打开了一个有关react-redux的问题。
关于javascript - Reactjs Redux。仅在使用 connect 时获取 ' Invalid hook call',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56111755/