Skip to content

Commit b5ef543

Browse files
bosung90rmevans9
authored andcommitted
chore(docs): Update Redux instructions
Update guide to match the code example and add another simpler example when not using middleware
1 parent 4f38796 commit b5ef543

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

docs/plugin-redux.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,20 @@ ReactotronConfig, you'll need to add `reactotron-redux` as plugin
5050
+ export default reactotron
5151
```
5252

53-
Then, where you create your Redux store, instead of using Redux's `createStore`,
54-
you can use Reactotron's `createStore` (`Reactotron` here being the output of your `reactotronConfig.js` file) which has the same interface.
53+
Then, add enhancer from `Reactotron.createEnhancer()` to `createStore` as last parameter
5554

55+
```diff
56+
import { createStore } from 'redux'
57+
+ import Reactotron from './ReactotronConfig'
58+
59+
- const store = createStore(rootReducer)
60+
+ const store = createStore(rootReducer, Reactotron.createEnhancer())
61+
+ // or const store = createStore(rootReducer, preloadedState, Reactotron.createEnhancer())
62+
```
63+
64+
Note: passing enhancer as last argument requires redux@>=3.1.0
65+
66+
## If you have middleware
5667

5768
```diff
5869
import { createStore } from 'redux'

0 commit comments

Comments
 (0)