react 16.x不在支持 <IE11 ,我们可能还需要对ie9和ie10做支持处理,我们可以采用core-js
安装:
npm install core-js
index.js引用
import 'core-js/es6/map'; import 'core-js/es6/set'; import React from 'react'; import ReactDOM from 'react-dom'; import {HashRouter as Router} from 'react-router-dom'; //redux 和react-redux(关联react和redux) import { createStore } from 'redux'; import { Provider } from 'react-redux'; //reducers 状态树state和逻辑操作 import rootRedux from './rootRedux.js' import App from './App.js'; import registerServiceWorker from './registerServiceWorker'; //创建状态树和设置 //生成状态树对象 const store = createStore(rootRedux); //start 状态树应用到全局 通过Provider ReactDOM.render( <Provider store={store}> <Router> <App /> </Router> </Provider>,document.getElementById('root')); registerServiceWorker();原文链接:https://www.f2er.com/react/302579.html