Skip to content

Commit 0d74bf3

Browse files
committed
Update readme file
1 parent 4069395 commit 0d74bf3

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
@@ -685,14 +685,13 @@ var Post = createReactClass({
685685

686686
The generator also accepts options:
687687

688-
- `--function` or `--func`: use `function ComponentName() {...}`
689-
- `--es6`: use `class ComponentName extends React.Component`
688+
- `--es6`: generates a function component
690689
- `--coffee`: use CoffeeScript
691690

692691
For example,
693692

694693
```sh
695-
rails g react:component ButtonComponent title:string --function
694+
rails g react:component ButtonComponent title:string --es6
696695
```
697696

698697
would generate:
@@ -701,7 +700,7 @@ would generate:
701700
import React from "react"
702701
import PropTypes from "prop-types"
703702

704-
function ButtonComponent() {
703+
function ButtonComponent(props) {
705704
return (
706705
<React.Fragment>
707706
Title: {this.props.title}
@@ -714,9 +713,10 @@ ButtonComponent.propTypes = {
714713
};
715714

716715
export default ButtonComponent
717-
718716
```
719717

718+
**Note:** In a Webpacker project, es6 template is the default template in the generator.
719+
720720
Accepted PropTypes are:
721721

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

0 commit comments

Comments
 (0)