Chrome中的React开发工具未显示<provider>标签

时间:2018-10-24 15:37:44

标签: react-redux google-chrome-devtools

我对redux项目有2个反应。其中之一在chrome这样的enter image description here

上的react dev工具中显示了标签

这个应用程序入口js文件就是这样-

import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import configureStore from './store/configureStore';

import ItemList from './components/ItemList';

const store = configureStore();

render(
    <Provider store={store}>
        <ItemList />
    </Provider>,
    document.getElementById('app')
);

而第二个项目不显示标签。而是显示这样的标记-enter image description here

与此相关的应用程序入口js文件就像这样-

import React from "react";
import ReactDOM from "react-dom";        
import App from "./components/App";
import Bootstrap from "bootstrap/dist/css/bootstrap.css";        
import 'font-awesome/css/font-awesome.min.css';
import "../assets/css/clean-blog.scss"; 
// import "../assets/scss/styles.scss";
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import store, { history } from './store';

ReactDOM.render(
   <Provider store={store}>
        <BrowserRouter history={history}>
            <App />
        </BrowserRouter>
   </Provider> , 
    document.getElementById('app')
);

我在这里做错了什么?

0 个答案:

没有答案