From 0d2c8a5d5de3923848cb82b1534da83e1f3ccb3d Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed <36672933+shoaib2527@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:48:30 +0500 Subject: [PATCH 1/4] Update plugin-redux.md Adds docs to integrate with redux-toolkit. --- docs/plugin-redux.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/plugin-redux.md b/docs/plugin-redux.md index bdc064057..955233c42 100644 --- a/docs/plugin-redux.md +++ b/docs/plugin-redux.md @@ -49,7 +49,19 @@ ReactotronConfig, you'll need to add `reactotron-redux` as plugin + export default reactotron ``` +## Using Redux-toolkit +Then, add 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 Then, add enhancer from `Reactotron.createEnhancer()` to `createStore` as last parameter ```diff @@ -63,7 +75,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' From c4a512a825362ebf66f0e1d117eb8446d296186c Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed <36672933+shoaib2527@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:55:59 +0500 Subject: [PATCH 2/4] correct typo in code snippet --- docs/plugin-redux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin-redux.md b/docs/plugin-redux.md index 955233c42..1bea15fb0 100644 --- a/docs/plugin-redux.md +++ b/docs/plugin-redux.md @@ -57,7 +57,7 @@ import {configureStore} from '@reduxjs/toolkit'; + import Reactotron from './ReactotronConfig' const store = configureStore({ ... (reducers, middlewares etc), - enhancers: __DEV__ ? [Reactotron.createEnhancer!()] : [], + + enhancers: __DEV__ ? [Reactotron.createEnhancer!()] : [], }); ``` From 6981b0a53877296e2e1d352f3d608e2c83a11d01 Mon Sep 17 00:00:00 2001 From: Shoaib Ahmed <36672933+shoaib2527@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:57:15 +0500 Subject: [PATCH 3/4] Update plugin-redux.md --- docs/plugin-redux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin-redux.md b/docs/plugin-redux.md index 1bea15fb0..e253515d4 100644 --- a/docs/plugin-redux.md +++ b/docs/plugin-redux.md @@ -57,7 +57,7 @@ import {configureStore} from '@reduxjs/toolkit'; + import Reactotron from './ReactotronConfig' const store = configureStore({ ... (reducers, middlewares etc), - + enhancers: __DEV__ ? [Reactotron.createEnhancer!()] : [], ++ enhancers: __DEV__ ? [Reactotron.createEnhancer!()] : [], }); ``` From 93f814ff5c609063db47384bf88a480f3e7b02f9 Mon Sep 17 00:00:00 2001 From: Jamon Holmgren Date: Tue, 28 Nov 2023 11:07:14 -0800 Subject: [PATCH 4/4] Update docs/plugin-redux.md --- docs/plugin-redux.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/plugin-redux.md b/docs/plugin-redux.md index e253515d4..ca41438e2 100644 --- a/docs/plugin-redux.md +++ b/docs/plugin-redux.md @@ -49,8 +49,9 @@ ReactotronConfig, you'll need to add `reactotron-redux` as plugin + export default reactotron ``` -## Using Redux-toolkit -Then, add enhancer from `Reactotron.createEnhancer()` to `enhancers` in `configureStore` +## 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'; @@ -59,10 +60,6 @@ const store = configureStore({ ... (reducers, middlewares etc), + enhancers: __DEV__ ? [Reactotron.createEnhancer!()] : [], }); -``` - -## Using Classic Redux -Then, add enhancer from `Reactotron.createEnhancer()` to `createStore` as last parameter ```diff import { createStore } from 'redux'