Description
Trying to add new some Action Creator in Redux DevTools using documentation here: https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md#actioncreators
This does not work with Rozenite because The rozeniteDevToolsEnhancer only forwards maxAge to @redux-devtools/remote's devToolsEnhancer — it ignores [actionCreators]. And RTK's devTools option only applies to the browser extension, not the remote DevTools.
Suggested solution
The fix: pass actionCreators directly to the @redux-devtools/remote devToolsEnhancer via the Rozenite enhancer call. Since the Rozenite wrapper doesn't support it, We can use composeWithRozeniteDevTools to compose the enhancer with the actionCreators, or call @redux-devtools/remote directly replicating the Rozenite setup.
Additional context
Replacing
getDefaultEnhancers().concat(
sentryReduxEnhancer,
global.__DEV__ ? [require('@rozenite/redux-devtools-plugin').rozeniteDevToolsEnhancer()] : [],
With:
getDefaultEnhancers().concat(
sentryReduxEnhancer,
global.__DEV__ ?
[
(() => {
const getDevServer =
require('react-native/Libraries/Core/Devtools/getDevServer').default;
const hostname = getDevServer().url.split('://')[1].split(':')[0];
return require('@redux-devtools/remote').devToolsEnhancer({
hostname,
port: 8765,
secure: false,
realtime: true,
maxAge: 50,
actionCreators: {
markAllSecondaryUserTooltipsSeen: () =>
setAppSettings({
[SEEN_SECONDARY_USER_DASHBOARD_TOOLTIP]: true,
}),
resetAllSecondaryUserTooltips: () =>
setAppSettings({
[SEEN_SECONDARY_USER_DASHBOARD_TOOLTIP]: false,
}),
},
});
})(),
]
: [],
),
Works fine but it seems wrong to replicate what Rozenite is doing
Description
Trying to add new some Action Creator in Redux DevTools using documentation here: https://github.com/reduxjs/redux-devtools/blob/main/extension/docs/API/Arguments.md#actioncreators
This does not work with Rozenite because The
rozeniteDevToolsEnhanceronly forwardsmaxAgeto @redux-devtools/remote'sdevToolsEnhancer— it ignores [actionCreators]. And RTK'sdevToolsoption only applies to the browser extension, not the remote DevTools.Suggested solution
The fix: pass
actionCreatorsdirectly to the @redux-devtools/remotedevToolsEnhancervia the Rozenite enhancer call. Since the Rozenite wrapper doesn't support it, We can usecomposeWithRozeniteDevToolsto compose the enhancer with theactionCreators, or call @redux-devtools/remote directly replicating the Rozenite setup.Additional context
Replacing
With:
Works fine but it seems wrong to replicate what Rozenite is doing