react native Redux-DevTools-Extension not working

997 views Asked by At

i'm using :

"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"

and this is how my redux store looks like:

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);

i read the documentation and did everything as it said but i couldn't get it working and chrome extension is not showing redux state. chrome redux-devtool-extension

i tried soultion 1.1 and 1.3 from redux-devtools-extension ducimentation but nothing changed. i also read this and this and this but non of them was helpful. how can i get it working ?

1

There are 1 answers

0
Gray On

i couldnot get it working. i tried react-native-debugger and it worked perfectly.

this is my store.js :

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;

// const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

export const store = createStore(
  persistedReducer,
  // undefined,
  composeEnhancers(applyMiddleware(...middleWare)),
);

export const persistor = persistStore(store);