Skip to content

zikosw/exp-remote-redux-dev-tools

Repository files navigation

React Native Counter App by Exponent with remote-redux-dev-tools

Simple React Native app to show how to use remote-redux-dev-tools

Run

  1. Clone this repository
  2. Install required packages by run yarn or npm install
  3. Run it with exp by run exp start or using XDE
  4. Start RemoteDev Server by run ./run-remote-dev-tools-server.sh that I provide or just run
./node_modules/remotedev-server/bin/remotedev.js  --hostname=localhost --port=8000
  1. Go to localhost:8000 😎

How to do this in my project?

  • Just change your store a bit
import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'remote-redux-devtools';    // Import this

const composeEnhancers = composeWithDevTools({
  realtime: true,
  port: 8000    // Port that your remotedev-server running
});

const store = createStore(
  reducer,
  preloadedState,      // Omit this if your don't have preload state
  composeEnhancers(    // Use this instead of compose from redux
    applyMiddleware(...middleware),
    // other store enhancers if any
  )
);

Or this if you don't use middleware

import { createStore } from 'redux';
import devToolsEnhancer from 'remote-redux-devtools';
const store = createStore(reducer, preloadedState, devToolsEnhancer());
const store = createStore(reducer, devToolsEnhancer()) // If you don't have preload state

About

React Native app by exponent with remote-redux-dev-tools

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published