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

Commit 502f8e0

Browse files
committed
Finally removing thunk for good. Fixes #550
1 parent 985d11a commit 502f8e0

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

UPGRADE_GUIDE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@
99
- **Flexibility**
1010
- **Features**
1111

12-
### Quick Start - v0.x to v1
12+
### Quick Start - v0.x to v1.2.6+
1313

1414
**Creating the store - version 0.x:**
1515
_Note:_ This way will still work in v1.0!
1616
```js
1717
import { createStore, combineReducers, applyMiddleware } from 'redux';
1818
import { modelReducer, formReducer } from 'react-redux-form';
19-
import thunk from 'redux-thunk';
2019

2120
const initialUserState = {
2221
firstName: '',
2322
lastName: ''
2423
};
2524

26-
const store = applyMiddleware(thunk)(createStore)(combineReducers({
25+
const store = createStore(combineReducers({
2726
user: modelReducer('user', initialUserState),
2827
userForm: formReducer('user', initialUserState)
2928
}));
@@ -43,7 +42,7 @@ const initialUserState = {
4342

4443
const store = createStore(combineForms({
4544
user: initialUserState,
46-
}), applyMiddleware(thunk));
45+
}));
4746

4847
export default store;
4948
```

docs/guides/models.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ To set up your app's models for RRF, it's recommended to use [`combineForms()`](
2020

2121
```jsx
2222
import { createStore, applyMiddleware } from 'redux';
23-
import thunk from 'redux-thunk'
2423
import { combineForms } from 'react-redux-form';
2524

2625
const store = createStore(combineForms({
2726
user: initialUser,
2827
goat: initialGoat,
29-
}), applyMiddleware(thunk));
28+
}));
3029

3130
export default store;
3231
```
@@ -54,7 +53,7 @@ For example, given this state:
5453

5554
```jsx
5655
const state = {
57-
user: {
56+
user: {
5857
firstName: 'John',
5958
lastName: 'Smith',
6059
phones: [
@@ -88,7 +87,7 @@ const store = createStore(combineForms({
8887
user: initialUser,
8988
goat: initialGoat,
9089
custom: myCustomReducer, // <= will be modeled()
91-
}), applyMiddleware(thunk));
90+
}));
9291
// ...
9392
```
9493

docs/guides/quickstart.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ This step-by-step guide assumes that you already have a project set up with:
99

1010
Check out the above links if you need any help with those prerequisites.
1111

12-
### 1. Install `react-redux-form` and its prerequisite dependencies (including `redux-thunk`).
12+
### 1. Install `react-redux-form` and its prerequisite dependencies:
1313

1414
- `npm install react react-dom --save`
1515
- `npm install redux react-redux --save`
16-
- `npm install redux-thunk --save`
1716
- `npm install react-redux-form --save`
1817

18+
**Note:** - `redux-thunk` is no longer required for versions 1.2.6 and higher. If you are using a previous version, make sure to install it as well.
19+
1920
### 2. Setup your app.
2021

2122
```jsx
@@ -43,6 +44,7 @@ class App extends React.Component {
4344
ReactDOM.render(<App />, document.getElementById('app'));
4445
```
4546

47+
4648
### 3. Setup your store.
4749

4850
We'll be using [`combineForms`]('../api/combineForms.html') to create the reducer that contains all of your `modelReducer`s, and
@@ -55,7 +57,6 @@ import {
5557
applyMiddleware
5658
} from 'redux';
5759
import { combineForms } from 'react-redux-form';
58-
import thunk from 'redux-thunk';
5960

6061
const initialUserState = {
6162
firstName: '',
@@ -64,11 +65,13 @@ const initialUserState = {
6465

6566
const store = createStore(combineForms({
6667
user: initialUserState,
67-
}), applyMiddleware(thunk));
68+
}));
6869

6970
export default store;
7071
```
7172

73+
**Note:** `redux-thunk` is no longer required for RRF versions 1.2.6 and higher. If you are using a previous version, make sure to configure your store to use `redux-thunk`.
74+
7275
### 4. Setup your form!
7376

7477
```jsx

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
"react": "^0.14.0 || ^15.0.0",
9797
"react-dom": "^0.14.7 || ^15.0.0",
9898
"react-redux": "^4.0.0 || ^5.0.0",
99-
"redux": "^3.0.0",
100-
"redux-thunk": "^2.0.1"
99+
"redux": "^3.0.0"
101100
}
102101
}

0 commit comments

Comments
 (0)