yaoningvital / blog

my blog
31 stars 4 forks source link

React--在chrome redux devtools中提示:No store found #165

Open yaoningvital opened 5 years ago

yaoningvital commented 5 years ago

一、问题

在Chrome的React devtools中查看 react store时,提示:No store found。

二、解决方案

1、首先要安装插件redux-devtools-extension

2、在创建store时加入:

import { applyMiddleware, createStore } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension';

let store = createStore(
    persistReducer(persistConfig, rootReducer),
    composeWithDevTools(
      applyMiddleware(...)
    )
  )