我在用着 :
"react-native": "0.63.3",
"react": "16.13.1",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0"
这就是我的 redux 商店的样子:
const persistConfig = {
key: 'root',
storage: AsyncStorage,
whitelist: ['auth', 'user', 'whiteCommonData'], //only navigation will be persisted
};
const initialState = {};
const middleWare = [thunk];
// if (process.env.NODE_ENV !== 'production') {
// middleware.push(createLogger());
// }
middleWare.push(createLogger());
const persistedReducer = persistReducer(persistConfig, rootReducer);
// const composeEnhancers = composeWithDevTools({
// // Specify name here, actionsBlacklist, actionsCreators and other options if needed
// });
const composeEnhancers =
(typeof window !== 'undefined' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) ||
compose;
export const store = createStore(
persistedReducer,
// undefined,
composeEnhancers(applyMiddleware(...middleWare)),
);
export const persistor = persistStore(store);
我阅读了文档并按照它所说的做了一切,但我无法让它工作,并且 chrome 扩展没有显示 redux 状态。
我从redux-devtools-extension ducimentation尝试了 soultion 1.1 和 1.3,但没有任何改变。我也读过这个、这个和这个,但没有一个是有帮助的。我怎样才能让它工作?