Answer the question
In order to leave comments, you need to log in
Why is null needed in these examples?
I started reading books on react. And in all examples, the author passes null as an argument. What for ?
var Component = React.createClass({
render: function() {
return React.DOM.span(null, "I'm so custom");
}
});
React.render(
React.createElement(Component),
document.getElementById("app")
);
var Component = React.createClass({
render: function() {
return React.DOM.span(null, "My name is " + this.props.name);
}
});
React.render(
React.createElement(Component, {
name: "Bob"
}),
document.getElementById("app")
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question