“No store found” when using Redux chrome extension

后端 未结 7 1130
轮回少年
轮回少年 2021-01-11 11:57

I have a problem with redux chrome extension.

I have the following code in my configureStore.js file :

import {createStore, applyMiddleware} from \'         


        
7条回答
  •  醉酒成梦
    2021-01-11 12:24

    I've got the solution from here.

    The right code is :

    import {createStore, applyMiddleware, compose} from 'redux';
    import rootReducer from '../reducers/index';
    import thunk from 'redux-thunk';
    
    export default function configureStore(initialState){
      return createStore(
        rootReducer,
        initialState,
        compose(
          applyMiddleware(thunk),
          window.devToolsExtension ? window.devToolsExtension() : f => f
        )
      );
    }
    

提交回复
热议问题