Skip to content

Reimplementation of Redux devtools inspector for in-app debugging

License

Notifications You must be signed in to change notification settings

mchudy/react-native-redux-devtools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-redux-devtools

npm version

Redux DevTools implementation for React Native based on redux-devtools-inspector.

For now, it's mostly a one-to-one port adjusted for mobile. Some features might be missing but I plan to implement them in the future.

Installation

npm install --save react-native-redux-devtools
yarn add react-native-redux-devtools

Usage

Create store composed with devtools:

import { createStore, compose, applyMiddleware } from 'redux';
import reducer from './reducer';
import { DevTools } from 'react-native-redux-devtools';

const enhancer = compose(
    applyMiddleware(), // apply middlewares that you are using
    DevTools.instrument() 
);

export const store = createStore(reducer, enhancer);

Then you can render devtools in your application:

import * as React from 'react';
import { View } from 'react-native';
import { DevTools } from 'react-native-redux-devtools';

class App extends React.Component {
  render() {
    return (
      <View>
        {/* Your app content */}
        <DevTools />
      </View>
    );
  }
}

Remember not to enable devtools in production builds! More details on how to set up devtools can be found in redux-devtools documentation.