mirror of
https://github.com/react-webpack-generators/generator-react-webpack.git
synced 2025-12-08 18:01:59 +00:00
update readme with rich and es6 options
This commit is contained in:
parent
9e7503bc10
commit
21b8314869
44
README.md
44
README.md
@ -103,6 +103,45 @@ And `src/styles/Foo.css` (or .sass, .less etc...) :
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### rich flag
|
||||||
|
|
||||||
|
For all you lazy programmers out there, we've added another shortcut - `rich` flag:
|
||||||
|
```bash
|
||||||
|
yo react-webpack:c foofoo --rich
|
||||||
|
```
|
||||||
|
This will give you all of react component's most common stuff :
|
||||||
|
````
|
||||||
|
var React = require('react/addons');
|
||||||
|
|
||||||
|
require('styles/Foofoo.sass');
|
||||||
|
|
||||||
|
var Foofoo = React.createClass({
|
||||||
|
mixins: [],
|
||||||
|
getInitialState: function() { return({}) },
|
||||||
|
getDefaultProps: function() {},
|
||||||
|
componentWillMount: function() {},
|
||||||
|
componentDidMount: function() {},
|
||||||
|
shouldComponentUpdate: function() {},
|
||||||
|
componentDidUpdate: function() {},
|
||||||
|
componentWillUnmount: function() {},
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<p>Content for Foofoo</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = Foofoo;
|
||||||
|
````
|
||||||
|
|
||||||
|
Just remove those you don't need, then fill and space out the rest.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Action
|
### Action
|
||||||
|
|
||||||
When using Flux or Reflux architecture, it generates an actionCreator in `src/scripts/actions` and it's corresponding test in `src/spec/actions`.
|
When using Flux or Reflux architecture, it generates an actionCreator in `src/scripts/actions` and it's corresponding test in `src/spec/actions`.
|
||||||
@ -238,6 +277,11 @@ Sets the style file's template and extension
|
|||||||
|
|
||||||
[flux](https://facebook.github.io/flux/) or [reflux](https://github.com/spoike/refluxjs)
|
[flux](https://facebook.github.io/flux/) or [reflux](https://github.com/spoike/refluxjs)
|
||||||
|
|
||||||
|
### es6
|
||||||
|
|
||||||
|
If you are using `es6`, and want to use its export functionality (and not webpack's), just add `--es6` flag when you create a component, action or srore.
|
||||||
|
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
Running `grunt test` will run the unit tests with karma. Tests are written using [Jasmine](http://jasmine.github.io/) by default.
|
Running `grunt test` will run the unit tests with karma. Tests are written using [Jasmine](http://jasmine.github.io/) by default.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user