react-redux 出现 Invalid hook call.Hooks can only be called inside of thebody of a function component

import ReactDOM from "react-dom"
import store from "./store"
import {Provider} from "react-redux"
import Todo from "./components/Todo"
const APP = (
	<Provider store={store}>
		<Todo />
	</Provider>
)

ReactDOM.render(APP,document.getElementById("root"));

在使用 react-redux 中 Provider时会出现以下报错
react-redux 出现 Invalid hook call.Hooks can only be called inside of thebody of a function component_第1张图片

解决方案

将react-redux的版本降低就可解决

你可能感兴趣的:(react)