Are the devtools supported when using this library with react-native?
If no, is it possible to support remote-redux-devtools which would allow devtools on react-native projects
You should be able to achieve basic remote-redux-devtools integration by setting devTools to false and instead passing devToolsEnhancer using the enhancers option:
import { configureStore } from 'redux-starter-kit'
import devToolsEnhancer from 'remote-redux-devtools'
// ...
const store = configureStore({
reducer,
devTools: false,
enhancers: [devToolsEnhancer]
})
This mostly works, but "actions dispatched from Redux DevTools will not flow to your middlewares". This is something that can only be fixed within redux-starter-kit by wrapping all store enhancers in redux-remote-devtools' composeWithDevTools, which is what devTools: true does for the "local" devtools extension.
@markerikson Do you think it makes sense to extend the devTools option to accept an additional 'remote' value (and perhaps, for symmetry, a value 'local' that is an alias for the currenttrue)?
@denisw Thanks for your help, actually it worked well by slightly editing your code:
import { configureStore } from "redux-starter-kit";
import devToolsEnhancer from "remote-redux-devtools";
const store = configureStore({
reducer,
devTools: false,
enhancers: [devToolsEnhancer({ realtime: true })]
});
I believe this was resolved by #130 .
I believe the point in https://github.com/reduxjs/redux-toolkit/issues/66#issuecomment-452815462 about needing to wrap all store enhancers with the composeWithDevTools from remote-redux-devtools in order to dispatch actions to middleware still holds. AFAICT, #130 only supports composeWithDevTools from redux-devtools-extension, which doesn't support remote connections.
@markerikson What do you think about @denisw's proposal to extend the devTools option?
This would probably introduce a dependency to remote-redux-devtools that would be problematic to tree-shake and add sub-dependencies to lodash, socketcluster-client and others, bringing RTK from ~12kb gzipped up to ~40kb gzipped.
So, adding a reference like that is pretty much out of the question :disappointed:
The only actual limiting factor here is whether hand-dispatching actions via the DevTools UI actually hits middleware, right? That seems like a _very_ niche use case.
Ah, I think you're right. I'm setting up Redux DevTools for the first time and thought that not being able to wrap the store enhancers might have more of a negative impact on its functionality, but it looks like it's not that big of a deal. Thanks @phryneas and @markerikson!
Most helpful comment
@denisw Thanks for your help, actually it worked well by slightly editing your code: