Code Monkey home page Code Monkey logo

Comments (2)

skurgansky-sugarcrm avatar skurgansky-sugarcrm commented on July 20, 2024

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

from vscode-redux-devtools.

skurgansky-sugarcrm avatar skurgansky-sugarcrm commented on July 20, 2024

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:

  1. install packages :
"@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. 
  1. in root directory in index.js add
// 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..
3. Run your dev server for remote redux dev tools: redux-devtools --open=electron --hostname=localhost --port=8000. Maybe you will need to install electron.
4. optional: add script for package.json:

"postinstall": "redux-devtools --open=electron --hostname=localhost --port=8000"
  1. Go with this code or something similar
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,
    }),
  ],
});

from vscode-redux-devtools.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.