File tree 1 file changed +2
-9
lines changed
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:
99
99
``` js
100
100
// app/assets/javascripts/components/post.jsx
101
101
102
- window .Post = React .createClass ({
103
- render : function () {
104
- return < h1> {this .props .title }< / h1>
105
- }
106
- })
107
-
108
- // or, equivalent:
109
102
class Post extends React .Component {
110
103
render () {
111
104
return < h1> {this .props .title }< / h1>
@@ -395,7 +388,7 @@ rails g react:component Post title:string published:bool published_by:instanceOf
395
388
would generate:
396
389
397
390
``` js
398
- var Post = React .createClass ( {
391
+ class Post extends React .Component {
399
392
propTypes: {
400
393
title: React .PropTypes .string ,
401
394
published: React .PropTypes .bool ,
@@ -411,7 +404,7 @@ var Post = React.createClass({
411
404
< / div>
412
405
);
413
406
}
414
- }) ;
407
+ };
415
408
```
416
409
417
410
The generator also accepts options:
You can’t perform that action at this time.
0 commit comments