react-bootstrap - ie11 问题

react-bootstrap - issue with ie11

我无法让 react-bootstrap 与 IE11 一起工作。这是我所做的:

  1. create-react-app test-app,然后 cd 到 test-app 文件夹
  2. npm install --save bootstrap
  3. npm install --save react-bootstrap
  4. npm start(此时应用程序在IE11中打开正常)
  5. 关闭浏览器并取消 npm start 操作
  6. 编辑 App.js 并在顶部添加以下行:
    • import Button from 'react-bootstrap/Button';
  7. 运行 npm start 再次在 IE11 中打开应用程序。浏览器屏幕是空白的。

我检查了 javascript 控制台,但没有看到任何错误。

关于如何使这项工作有任何想法吗?

解决方案是安装 react-app-polyfill,然后将 import 'react-app-polyfill/ie9'; 添加到 src/index.js 的第一行。有关详细信息,请参阅 here

非常感谢mxschmitt on github for providing the solution