olebedev / go-starter-kit

[abandoned] Golang isomorphic react/hot reloadable/redux/css-modules/SSR starter kit
Other
2.82k stars 359 forks source link

How to make redux-devtools work? #88

Closed zhangmaku closed 7 years ago

zhangmaku commented 7 years ago
        import DevTool from '../dev-tool';
         ...
         ...
          }
        ]} />
      <DevTool />
      <h1 className={example}>
        Hot Reloadable <br />
        Golang + React + Redux + Css-Modules

error Redux DevTools could not render. Did you forget to include DevTools.instrument() in your store enhancer chain before using createStore()?

iKonrad commented 7 years ago

Here's my createStore part with devTools:

    return reduxCreateStore(
        reducers,
        state,
        compose(
            applyMiddleware.apply(null, middlewares),
            typeof window === 'object' && typeof window.devToolsExtension !== 'undefined' ? window.devToolsExtension() : f => f
        )
    );

you just need to add this line typeof window === 'object' && typeof window.devToolsExtension !== 'undefined' ? window.devToolsExtension() : f => f to compose when creating a store and it should work