Skip to content

Commit e568a82

Browse files
committed
Update readme file
1 parent d341357 commit e568a82

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

682682
The generator also accepts options:
683683

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

688687
For example,
689688

690689
```sh
691-
rails g react:component ButtonComponent title:string --function
690+
rails g react:component ButtonComponent title:string --es6
692691
```
693692

694693
would generate:
@@ -697,7 +696,7 @@ would generate:
697696
import React from "react"
698697
import PropTypes from "prop-types"
699698

700-
function ButtonComponent() {
699+
function ButtonComponent(props) {
701700
return (
702701
<React.Fragment>
703702
Title: {this.props.title}
@@ -710,9 +709,10 @@ ButtonComponent.propTypes = {
710709
};
711710

712711
export default ButtonComponent
713-
714712
```
715713

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

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

0 commit comments

Comments
 (0)