USER MATERIAL ui
1.jsx
var React = require('react'),
mui = require('material-ui'),
RaisedButton = mui.RaisedButton;
var MyAwesomeReactComponent = React.createClass({
render: function() {
return (
<RaisedButton label="Default" />
);
}
});
module.exports = MyAwesomeReactComponent;
browserify 1.jsx -o 1.js
Error: Parsing file C:\Users\wzx\AppData\Roaming\npm\1.jsx: Unexpected token (7:
11)
at Deps.parseDeps
unknow <RaisedButton label="Default" />
github :https://github.com/callemall/material-ui
1 npm install material-ui
2 Then how to do?
3 ...
4....
i what should i do next?
i need help, i have done a few days
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!
来源:https://stackoverflow.com/questions/29045003/material-ui-installation-configure