Why IE 11 display blank page rendering react app

后端 未结 8 2011
借酒劲吻你
借酒劲吻你 2020-11-30 07:04

I have an issue with IE 11 and my react app. I use Webpack, babel and polyfill.io cdn and all is nice until rendering bundeled file, then it stops doing anything. Do you hav

8条回答
  •  醉话见心
    2020-11-30 07:44

    The package react-app-polyfill will help to work react app in ie9 & ie11. This will work both in development and production environment.

    Please follow the steps 1. Edit the index.js file and add the following lines at the very top of the file.

        import 'react-app-polyfill/ie9';
        import 'react-app-polyfill/ie11';
        import 'react-app-polyfill/stable';
    
    1. Edit the Package.json file and add "ie 11" in the development sections of the browserslist. The default prouduction list is quite generous and does include ie 11 already via the >0.2%

      "browserslist": {
      "production": [
        ">0.2%",
        "not dead",
        "not op_mini all"
      ],
      "development": [
        "last 1 chrome version",
        "last 1 firefox version",
        "last 1 safari version",
        "ie 11"
      ]
      

      }

    2. delete your entire node_modules folder

    3. run npm install to re-install the node_modules

    4. run npm start to run again

提交回复
热议问题