Skip to content

Commit

Permalink
chore(docs): Update redux to add section about RTK
Browse files Browse the repository at this point in the history
Closes #1323

Thank you for your contribution, @shoaib2527!
  • Loading branch information
markrickert committed Dec 13, 2023
1 parent e2f4624 commit 777d32a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docs/plugins/redux.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,22 @@ ReactotronConfig, you'll need to add `reactotron-redux` as plugin
+ export default reactotron
```

Then, add enhancer from `Reactotron.createEnhancer()` to `createStore` as last parameter
## Using Redux Toolkit (RTK)

If you're using RTK, add the enhancer from `Reactotron.createEnhancer()` to `enhancers` in `configureStore`

```diff
import {configureStore} from '@reduxjs/toolkit';
+ import Reactotron from './ReactotronConfig'
const store = configureStore({
... (reducers, middlewares etc),
+ enhancers: __DEV__ ? [Reactotron.createEnhancer!()] : [],
});
```

## Using Classic Redux

Add enhancer from `Reactotron.createEnhancer()` to `createStore` as last parameter

```diff
import { createStore } from 'redux'
Expand All @@ -71,7 +86,7 @@ import { createStore } from 'redux'

Note: passing enhancer as last argument requires redux@>=3.1.0

## If you have middleware
### If you have middleware

```diff
import { createStore } from 'redux'
Expand Down

0 comments on commit 777d32a

Please sign in to comment.