ERROR in ./~/react-tap-event-plugin/src/injectTapEventPlugin.js

后端 未结 5 1722
别跟我提以往
别跟我提以往 2021-01-17 10:01

React noob here. Trying to clone and run https://github.com/strangebnb/react-airbnb

I clone. run npm install. Then webpack but I get

ERROR in ./~/rea         


        
5条回答
  •  误落风尘
    2021-01-17 10:55

    I forked that repo and fixed this issue in my repo. Also, sent pull request to the owner of original repo. Here's link to my forked repo: https://github.com/pankajvishwani/react-airbnb

    If you don't want to clone my repo, you can add the following in webpack.config.js:

    var reactDomLibPath = path.join(__dirname, "./node_modules/react-dom/lib");
    var alias = {};
    ["EventPluginHub", "EventConstants", "EventPluginUtils", "EventPropagators",
     "SyntheticUIEvent", "CSSPropertyOperations", "ViewportMetrics"].forEach(function(filename){
        alias["react/lib/"+filename] = path.join(__dirname, "./node_modules/react-dom/lib", filename);
    });
    
    module.exports = {
      ...
      resolve: {alias: alias},
      ...
    }
    

提交回复
热议问题