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 HelloWorld = React.createClass({
displayName: 'HelloWorld',
render: function() {
return (
<span>Hello World</span>
);
}
});
var HelloWorld = function() {
return <span>Hello World</span>;
};
HelloWorld.displayName = 'HelloWorld';
console.log(React.renderToString(<HelloWorld />));