2 ms·
First, your markup for the component lives with the JS handling for that component... you can require in child components and render them in the same manner.. u
by tracker1 12y ago
First, your markup for the component lives with the JS handling for that component... you can require in child components and render them in the same manner.. using harmony/es6 syntax...
var React = require('react')
var other = require('../other-control')
var { div, h2 } = React.DOM;
module.exports = React.createClass({
render: function(){
return div({className="foo"}, [
h2(null,'My playa'),
other()
]);
}
});
I don't use the JSX syntax, for testability, coffee-script can be a lot cleaner... With multiple components in a larger application and webpack it gets really nice.