我在这篇文章中做了确切的指示:https://medium.com/@samueldinesh/setting-up-redux-devtools-a-simple-guide-3b386a6254fa
我得到的错误是:
这是我的代码:
import {StrictMode} from 'react'
import {createRoot} from 'react-dom/client'
import { createStore } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import App from './App'
import './styles/globals.css'
import { store } from './store/store'
import { Provider } from 'react-redux'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
const rootElement = document.querySelector('#main')
const root = createRoot(rootElement)
const currentStore = createStore(
store,
composeWithDevTools()
)
root.render(
<StrictMode>
<Provider store={currentStore}>
<Router>
<Routes>
<Route path="/*" element={<App />} />
</Routes>
</Router>
</Provider>
</StrictMode>
)
我错过了什么?
1条答案
按热度按时间s4chpxco1#
你正经过一家商店。你应该经过rootReducer
//显示链接