material ui Installation configure

不打扰是莪最后的温柔 提交于 2019-12-08 13:17:31

I got confused as well, but I worked it out after I searched around.

$ sudo npm install -g browserify
$ npm install --save-dev reactify

you now have all the dependencies, next you need the file, your example is:

var React = require('react'),
  mui = require('material-ui'),
  RaisedButton = mui.RaisedButton;

var MyAwesomeReactComponent = React.createClass({

  render: function() {
    return (
      <RaisedButton label="Default" />
    );
  }

});

module.exports = MyAwesomeReactComponent;

you then need run this command

$ browserify -t reactify <path to jsx file> -o <path to output location, including file name>

this will output the file, which will have everything you need!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!