0

I'm having trouble seeing my state in the Redux Dev Tools. I added the code from zalmoxisus into my createStore, but nothing is displayed. In my reducers I'm also returning the state as a default (using switch case) but still nothing is displayed in state. Can anyone help with this?

code for the store

enter image description here

enter image description here

  • Does this answer your question? [Need help displaying and seeing state in Redux Dev Tools](https://stackoverflow.com/questions/65528025/need-help-displaying-and-seeing-state-in-redux-dev-tools) – HMR Jan 01 '21 at 07:59

3 Answers3

1

try this to use this:

window.devToolsExtension ? window.devToolsExtension() : f => f

instead of:

window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
Taghi Khavari
  • 6,272
  • 3
  • 15
  • 32
1
import {combineReducers} from "redux";
import gamesReducer from ... //

const rootReducer = combineReducers({
  gamesReducer
});

export default rootReducer;

You used rootReducer like this right? If it is try redux-devtools-extension package, easy to setup.

dogukyilmaz
  • 585
  • 5
  • 11
1

Try this

import { createStore, applyMiddleware, compose } from 'redux'
import reduxImmutableStateInvariant from 'redux-immutable-state-invariant'
import thunk from 'redux-thunk'
import rootReducer from '../reducers'

export const middleware = [thunk]

export default function configureStore(initialState) {
  return createStore(
    rootReducer,
    initialState,
    compose(
      applyMiddleware(thunk, reduxImmutableStateInvariant()),
      window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f,
    ),
  )
}
Mohammad Fared
  • 588
  • 1
  • 7
  • 19