已关闭。此问题需要details or clarity。当前不接受答案。
**想要改进此问题?**添加详细信息并通过editing this post阐明问题。
3天前关闭。
Improve this question
我需要在configureStore代码中转换createStore代码
我试着把它转过来,但没有成功:
import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import thunk from 'redux-thunk'
import rootReducer from './reducers/index'
import { composeWithDevTools } from 'redux-devtools-extension'
const store = createStore(
rootReducer,
composeWithDevTools(applyMiddleware(thunk))
)
const DataProvider = ({ children }) => {
return (
<Provider store={store}>
{children}
</Provider>
)
}
export default DataProvider
1条答案
按热度按时间s5a0g9ez1#
configureStore
是@reduxjs/toolkit
包的一部分: