Uncaught Error: Minified React error #130

前端 未结 2 1907
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-21 21:58

So here is what my code looks like

---------index.js-----

var React =require(\'react\');
var ReactDOM =require(\'react-dom\');
var App=require(\'../compo         


        
2条回答
  •  太阳男子
    2021-01-21 22:23

    You're mixing up require, and import / export.

    Since you're running webpack, all of your React code (and anything that gets transpiled by babel via webpack) should stick to using import/export. require should only be used in places like js that's directly run by node.

    In your index.js, change all the requires to imports and see if that helps.

提交回复
热议问题