React-native-debugger: Redux Does Not Connect

Created on 29 Aug 2017  路  5Comments  路  Source: jhen0409/react-native-debugger

React Native Debugger version: 0.7.6
React Native version: 0.47.2
Platform: iOS 10.3
Is real device of platform: No; simulator
Operating System: macOS Sierra

Using "remote-redux-devtools": "^0.5.12"

Store is created as such:

import reducers from '../reducers/index';
import { composeWithDevTools } from 'remote-redux-devtools';
import { createStore, applyMiddleware } from 'redux';
...
const store = createStore(reducers, composeWithDevTools(applyMiddleware(thunk)));

If I use VSCode Redux Devtools it works:

screen shot 2017-08-28 at 7 18 06 pm

However React Native Debugger looks like this:
screen shot 2017-08-28 at 7 19 28 pm

(Yes even when VSCode is totally closed)

You can see the last line in the log is showing that it's connected to remotedev-server as part of devTools.js which is part of remote-redux-devtools from what I can tell.

What can be done to troubleshoot?

question

Most helpful comment

@jhen0409 Thank you so much! I had read the documentation but I didn't understand the difference between remote-redux-devtools and redux-devtools-extension -- I figured they worked the same since their wrapper method was the same name. Big mistake!

For anyone else who may run into this issue:
yarn remove remote-redux-devtools; yarn add redux-devtools-extension

In createStore (no change from above):
const store = createStore(reducers, composeWithDevTools(applyMiddleware(thunk)));

But the import (by the same name) now comes from redux-devtools-extension:
import { composeWithDevTools } from 'redux-devtools-extension';

P.S. @jhen0409 Thanks so much for your hard work on this project. It's immensely helpful to us!

All 5 comments

Please read documentation. (Redux DevTools Integration)

I guess you have same misunderstanding with https://github.com/jhen0409/react-native-debugger/issues/29.

@jhen0409 Thank you so much! I had read the documentation but I didn't understand the difference between remote-redux-devtools and redux-devtools-extension -- I figured they worked the same since their wrapper method was the same name. Big mistake!

For anyone else who may run into this issue:
yarn remove remote-redux-devtools; yarn add redux-devtools-extension

In createStore (no change from above):
const store = createStore(reducers, composeWithDevTools(applyMiddleware(thunk)));

But the import (by the same name) now comes from redux-devtools-extension:
import { composeWithDevTools } from 'redux-devtools-extension';

P.S. @jhen0409 Thanks so much for your hard work on this project. It's immensely helpful to us!

Just popping in to say that I also had the same misunderstanding as #29 (and this), @Clete2's comment was exactly what I needed. Thanks to you both 鉂わ笍

My goal was to make it possible to debug my app with both VSCode and React Native Debugger. In case someone is looking for the same thing, here's how I managed to do it:

const composeWithDevTools = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
  || require('remote-redux-devtools').composeWithDevTools;
composeEnhancers = composeWithDevTools({
  serialize: {
    options: {
      symbol: true,
    },
  },
});
import {聽createStore, applyMiddleware  } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from 'redux-thunk';
import placeReducer from './placeReducer';

const store = createStore(
    placeReducer,
    composeWithDevTools(applyMiddleware(thunk)));
export default store

Yet when debugging react-native remote debugger, devtools redux extension says no store found, app works fine.

I have my provider with App as such (there is no outside access to wrap the App Element when using expo and react-native, e.g. index.ts)

  <Provider store={store}>
        <View style={styles.container}>
          <PlaceDetail />
          <PlaceForm />
        </View>
      </Provider>

Then PlaceForm is connected:

export default connect(mapStateToProps, mapDispatchToProps)(PlaceForm);

Yet no store found

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghasemikasra39 picture ghasemikasra39  路  3Comments

tannera picture tannera  路  5Comments

Visylvius picture Visylvius  路  3Comments

JodiWarren picture JodiWarren  路  3Comments

jsdario picture jsdario  路  3Comments