Merge pull request #298 from m90/patch-1

use pure function instead of creating class
This commit is contained in:
Mike Donaghy
2017-02-12 16:10:48 -06:00
committed by GitHub

View File

@@ -1,12 +1,8 @@
var React = require('react'); var React = require('react');
var HelloWorld = React.createClass({ var HelloWorld = function() {
displayName: 'HelloWorld', return <span>Hello World</span>;
render: function() { };
return ( HelloWorld.displayName = 'HelloWorld';
<span>Hello World</span>
);
}
});
console.log(React.renderToString(<HelloWorld />)); console.log(React.renderToString(<HelloWorld />));