Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 9180f7d

Browse files
committed
Merge branch 'master' of github.com:davidkpiano/react-redux-form
2 parents 62ba2b9 + e081871 commit 9180f7d

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# React Redux Form 🍂
1+
# React Redux Form ❄️
22

33
[![Join the chat at https://gitter.im/react-redux-form/Lobby](https://badges.gitter.im/react-redux-form/Lobby.svg)](https://gitter.im/react-redux-form/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
44
[![Build Status](https://travis-ci.org/davidkpiano/react-redux-form.svg?branch=master)](https://travis-ci.org/davidkpiano/react-redux-form) [![npm version](https://badge.fury.io/js/react-redux-form.svg)](https://badge.fury.io/js/react-redux-form)
@@ -15,13 +15,43 @@ React Redux Form is a collection of reducer creators and action creators that ma
1515

1616
```bash
1717
# Dependencies (you probably already have these)
18-
npm install react react-dom redux react-redux redux-thunk --save
18+
npm install react react-dom redux react-redux --save
1919

20-
# version 1.0.x
20+
# version 1.x.x
2121
npm install react-redux-form@latest --save
2222
```
2323

24+
## Zero-Boilerplate `<LocalForm>`
25+
26+
If you want to get up and running with forms quickly without having to set up Redux, [just use Local Forms](http://davidkpiano.github.io/react-redux-form/docs/guides/local.html):
27+
28+
```js
29+
import React from 'react';
30+
import { LocalForm, Control } from 'react-redux-form';
31+
32+
export default class MyApp extends React.Component {
33+
handleChange(values) { ... }
34+
handleUpdate(form) { ... }
35+
handleSubmit(values) { ... }
36+
render() {
37+
return (
38+
<LocalForm
39+
onUpdate={(form) => this.handleUpdate(form)}
40+
onChange={(values) => this.handleChange(values)}
41+
onSubmit={(values) => this.handleSubmit(values)}
42+
>
43+
<Control.text model=".username" />
44+
<Control.text model=".password" />
45+
</LocalForm>
46+
);
47+
}
48+
}
49+
```
50+
51+
That's all you need. Seriously. [Read the Documentation](http://davidkpiano.github.io/react-redux-form/docs/guides/local.html) for more information.
52+
2453
## Quick Start
54+
For more fine-grained control (such as using custom reducers, storing form state globally, dispatching actions, etc.), you'll want to set up a Redux store for your forms.
2555

2656
Be sure to read the [step-by-step quick start guide](http://davidkpiano.github.io/react-redux-form/docs/guides/quickstart.html) in the documentation.
2757

@@ -66,7 +96,7 @@ class MyForm extends React.Component {
6696
return (
6797
<Form model="user" onSubmit={(val) => this.handleSubmit(val)}>
6898
<label>Your name?</label>
69-
<Control.text model="user.name" />
99+
<Control.text model=".name" />
70100
<button>Submit!</button>
71101
</Form>
72102
);

0 commit comments

Comments
 (0)