use pure function instead of creating class

This commit is contained in:
Frederik Ring
2016-05-20 17:38:27 +02:00
parent 9f63e88962
commit 433a59dba2

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 />));