File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,6 @@ Now, you can create React components in `.jsx` files:
9999``` js
100100// app/assets/javascripts/components/post.jsx
101101
102- window .Post = React .createClass ({
103- render : function () {
104- return < h1> {this .props .title }< / h1>
105- }
106- })
107-
108- // or, equivalent:
109102class Post extends React .Component {
110103 render () {
111104 return < h1> {this .props .title }< / h1>
@@ -395,7 +388,7 @@ rails g react:component Post title:string published:bool published_by:instanceOf
395388would generate:
396389
397390``` js
398- var Post = React .createClass ( {
391+ class Post extends React .Component {
399392 propTypes: {
400393 title: React .PropTypes .string ,
401394 published: React .PropTypes .bool ,
@@ -411,7 +404,7 @@ var Post = React.createClass({
411404 < / div>
412405 );
413406 }
414- }) ;
407+ };
415408```
416409
417410The generator also accepts options:
You can’t perform that action at this time.
0 commit comments