【发布时间】:2020-07-05 08:40:02
【问题描述】:
我正在关注 React 教程,并且讲师在 Chrome 上安装了一个扩展程序,即 Redux Devtools。就我而言,我想知道为什么我的扩展程序似乎不活动(灰色)。在我的 chrome 扩展设置中,它是 On,站点访问设置为 在所有站点上,允许访问文件 URL 已打开,但当我查看我的 Redux 选项卡时,它显示:
No store found. Make sure to follow the instructions.
在 .js 文件中,有如下声明:
const ReactReduxDevTools = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
let store;
if(window.navigator.userAgent.includes("Chrome") && ReactReduxDevTools){
store = createStore(
rootReducer,
initialState,
compose(
applyMiddleware(...middleware),
ReactReduxDevTools)
);
}else{
...
}
可能是什么问题?与 Chrome 的兼容性?
【问题讨论】:
标签: reactjs redux google-chrome-extension react-redux