Skip to content

Commit bf217f4

Browse files
author
Kai Wood
committed
Update README to hint for newer syntax
Since React 0.12 the ES6 style syntax can be used with CoffeeScript classes as well. The docs should give a hint for this.
1 parent 0573ae2 commit bf217f4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,14 @@ Component = React.createClass
323323
`<ExampleComponent videos={this.props.videos} />`
324324
```
325325

326+
Alternatively, the newer ES6 style class based syntax can be used like this:
327+
328+
```coffee
329+
class Component extends React.Component
330+
render: ->
331+
`<ExampleComponent videos={this.props.videos} />`
332+
```
333+
326334
## Extending `react-rails`
327335

328336
You can extend some of the core functionality of `react-rails` by injecting new implementations during configuration.

0 commit comments

Comments
 (0)