Create stateful React Component using goodness from redux
Quick start: Say Hi
The form component that reads name and email from the user and submit the form to the API server.
;const createComponent = ;const Component =;
This basically covers everything for creating a stateful React component.
See the full list of API.
redux-component requires React 0.13 or later.
npm install --save redux-component
All functions are available on the top-level export.
React 0.14 introduces stateless function components. However, what if I want to use pure functions to create stateful React components?
Manage a component's local state using a local redux store.
A isolated redux store is created for each React component instance. It has nothing to do with your global flux architecture. There are several goodness for this approach:
- Express component state transition in a single
- Event callbacks in redux actions are clean and easy to reason about
- You build pure functions all the way:
- No more
this.setState()touched in your code
- Easy to test React component implements
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request