Skip to content

Commit 9afba14

Browse files
committed
Update readme file
1 parent 6f9b0a0 commit 9afba14

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,13 @@ var Post = createReactClass({
682682

683683
The generator also accepts options:
684684

685-
- `--function` or `--func`: use `function ComponentName() {...}`
686-
- `--es6`: use `class ComponentName extends React.Component`
685+
- `--es6`: generates a function component
687686
- `--coffee`: use CoffeeScript
688687

689688
For example,
690689

691690
```sh
692-
rails g react:component ButtonComponent title:string --function
691+
rails g react:component ButtonComponent title:string --es6
693692
```
694693

695694
would generate:
@@ -698,7 +697,7 @@ would generate:
698697
import React from "react"
699698
import PropTypes from "prop-types"
700699

701-
function ButtonComponent() {
700+
function ButtonComponent(props) {
702701
return (
703702
<React.Fragment>
704703
Title: {this.props.title}
@@ -711,9 +710,10 @@ ButtonComponent.propTypes = {
711710
};
712711

713712
export default ButtonComponent
714-
715713
```
716714

715+
**Note:** In a Webpacker project, es6 template is the default template in the generator.
716+
717717
Accepted PropTypes are:
718718

719719
- Plain types: `any`, `array`, `bool`, `element`, `func`, `number`, `object`, `node`, `shape`, `string`

0 commit comments

Comments
 (0)