reactjs - fetch as google displays blank page only

前端 未结 8 936
囚心锁ツ
囚心锁ツ 2021-01-06 05:09

I\'ve just coded my first website using reactjs, but when I check how google sees my website, I receive the following result:

My HTML file looks like this:

8条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 05:21

    Try adding browser shims. Note that it doesn’t matter if you use Babel to compile your code, you still need polyfills for older browsers and for headless browsers such as Google Bot or PhantomsJS.

    npm install --save es5-shim es6-shim

    // in your frontend/index.js, as early as possible
    import 'es5-shim';
    import 'es6-shim';
    

    You can read more here

提交回复
热议问题