Skip to content

Commit

Permalink
use pure function instead of creating class
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed May 20, 2016
1 parent 9f63e88 commit 433a59d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions j/jsx.js
Original file line number Diff line number Diff line change
@@ -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 />));

0 comments on commit 433a59d

Please sign in to comment.