Closed skurgansky-sugarcrm closed 1 year ago
i managed to connect via "@redux-devtools/cli": "^2.0.0", but connection is not stable ... it disconnects and reconnects all the time
npx redux-devtools --hostname 127.0.0.1 --port 8000
then RN
import {configureStore} from '@reduxjs/toolkit';
import devToolsEnhancer from 'remote-redux-devtools';
const composeEnhancers = composeWithDevTools({
realtime: true,
hostname: '127.0.0.1',
port: 8000,
name: Platform.OS,
...Platform.select({
ios: {
maxAge: 1000,
latency: 2000,
autoPause: true,
},
android: {
maxAge: 500,
latency: 1000,
autoPause: false,
},
}),
});
let store = configureStore({
reducer: persistedReducer,
middleware(getDefaultMiddleware) {
return getDefaultMiddleware({
serializableCheck: {
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
},
})
.prepend(api.middleware)
.concat(rtkQueryErrorLogger);
},
devTools: false,
enhancers: defaultEnhancers => [composeEnhancers(...defaultEnhancers)],
});
then i tried vscode redux devtools and browses extention for Redux DevTools. All the same. No stable connection yet. not even 5 seconds before it falls
It looks like remote-redux-devtools obsolete package? Documentation is a mess. We need to go on with @redux-devtools/remote.
Here is working example for RN project:
"@redux-devtools/cli": "^2.0.0",
"@redux-devtools/remote": "^0.8.0",
"react-native-get-random-values": "^1.8.0"
don't forget `cd ios & pod install` for react-native-get-random-values.
// fix: https://www.npmjs.com/package/uuid#react-native--expo
import 'react-native-get-random-values';
without it your app will throw error with crypto.getRandormSomething..
redux-devtools --open=electron --hostname=localhost --port=8000
. Maybe you will need to install electron. "postinstall": "redux-devtools --open=electron --hostname=localhost --port=8000"
import {devToolsEnhancer} from '@redux-devtools/remote';
let store = configureStore({ reducer: rootReducer, // middleware: [], // your middleware devTools: false, enhancers: [ devToolsEnhancer({ name: 'myReduxApp', realtime: true, hostname: '192.168.1.122', // IP address of machine where redux-devtools server is running port: 8000, trace: true, traceLimit: 10, }), ], });
websocket do not connect ...