Answer the question
In order to leave comments, you need to log in
How to compile jsx?
All greetings
Faced small difficulties.
I decided to use elements of the material ui framework material-ui.com on the site I installed it via npm + browserify and reactify.
I created a main.js file and put the code from the material ui site into it
/**
* @jsx React.DOM
*/
var React = require('react'),
mui = require('material-ui'),
PaperButton = mui.PaperButton;
var SomeAwesomeComponent = React.createClass({
render: function() {
return (
<PaperButton type={PaperButton.Types.FLAT} label="Default" />
);
}
});
module.exports = SomeAwesomeComponent;
Answer the question
In order to leave comments, you need to log in
Even with its use, it displays an error, the problem is with line 13
There is a react-tools package , it contains a JSX compiler to regular JS.
More about the package.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question