react-redux 开发人员工具在扩展栏上处于非活动状态并且不显示应用程序的状态

react-redux developer tool is inactive on the extension bar and not showing the state of the application

我刚刚完成了 redux-tutorial 并试图在 redux-devtools 中查看状态。但是 redux-devtools 在扩展栏中处于非活动状态,当我单击它时它显示菜单 “向右,向左等”。当我选择其中一个选项时,它会显示处于不存在状态的数据。这是我的 index.js 文件

import React from 'react';
import {render} from 'react-dom';
import './index.css';
import { createStore } from 'redux'
import App from './components/App';
import rootReducer from './reducers';
import * as serviceWorker from './serviceWorker';
import {Provider} from 'react-redux';

const store = createStore(rootReducer)

render(
    <Provider store={store}>
        <App />
    </Provider>,
    document.getElementById('root')
)
serviceWorker.unregister();

createStore

中添加REDUX_DEVTOOLS_EXTENSION
const store = createStore(
   rootReducer, 
   window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
  );