Use of browserify to pack React components

前端 未结 1 1442
执笔经年
执笔经年 2021-01-22 17:59

I am trying to learn browserify to manage my javascript. My first simple task is to create a react.js file which will be generated by gulp + browserify

var brows         


        
1条回答
  •  执笔经年
    2021-01-22 18:48

    Your react.js file/module isn't exposing the variables React and ReactDOM you instantiate. In node, you make these methods public by modifying the module.exports object like so:

    module.exports = {
      React: React,
      ReactDOM: ReactDOM
    }
    

    0 讨论(0)
提交回复
热议问题