gpt4 book ai didi

reactjs - 如何将 Redux DevTools 扩展添加到我的 React-Redux 商店?

转载 作者:行者123 更新时间:2023-12-03 13:28:48 25 4
gpt4 key购买 nike

我正在尝试将 Redux DevTools Chrome 扩展添加到我的 redux 存储中,并在此处进行描述:http://extension.remotedev.io/

这是我的商店:

let store;

const initStore = ({onRehydrationComplete}) => {

store = createStore(
combineReducers({
...reactDeviseReducers,
form: formReducer,
router: routerReducer,
apollo: apolloClient.reducer(),
cats: catReducer
}),
{},
compose(
applyMiddleware(
thunk,
routerMiddleware(history),
apolloClient.middleware()
),
autoRehydrate()
),
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
);

persistStore(store, {
blacklist: [
'form'
]
}, onRehydrationComplete);

return store;
};

Chrome 中的扩展程序仍然显示:

No store found. Make sure to follow the instructions.

知道我做错了什么吗?

最佳答案

开发工具需要位于您的作品中。

尝试:

let store;

const initStore = ({onRehydrationComplete}) => {

store = createStore(
combineReducers({
...reactDeviseReducers,
form: formReducer,
router: routerReducer,
apollo: apolloClient.reducer(),
cats: catReducer
}),
{},
compose(
applyMiddleware(
thunk,
routerMiddleware(history),
apolloClient.middleware()
),
autoRehydrate(),
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)
);

persistStore(store, {
blacklist: [
'form'
]
}, onRehydrationComplete);

return store;
};

关于reactjs - 如何将 Redux DevTools 扩展添加到我的 React-Redux 商店?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44164058/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com