Answer the question
In order to leave comments, you need to log in
Why doesn't jsx work?
Why methods in jsx do not work, here is an example:
var HelloMessage = React.createClass({
render: function() {
return <div>Hello {this.props.name}</div>;
}
});
ReactDOM.render(<HelloMessage name="John" />, mountNode);
<!DOCTYPE html>
html(lang="en")
head
meta(charset="UTF-8")
title show react
script(src='libs/react/react.min.js')
script(src='libs/react/react-dom.min.js')
script(src='libs/react/react-dom-server.min.js')
script(src='libs/react/react-with-addons.min.js')
body
.container
h1 Gulp file
hr
script(src='jsx_template/test.js')
Uncaught ReferenceError: mountNode is not defined
Answer the question
In order to leave comments, you need to log in
because mountNode is not defined
https://facebook.github.io/react/docs/getting-star...
ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
);
define mountNode first for some element from your html
something like:
mountNode = document.getElementById('container');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question