Skip to content

Instantly share code, notes, and snippets.

@Chiamaka
Last active January 6, 2018 12:07
Show Gist options
  • Save Chiamaka/b8beab610fe6b2e97a04f7457f45ec0d to your computer and use it in GitHub Desktop.
Save Chiamaka/b8beab610fe6b2e97a04f7457f45ec0d to your computer and use it in GitHub Desktop.
Configuring react-native-debugger (https://github.com/jhen0409/react-native-debugger) in your react-native project

Installing react native debugger

Step 1: brew update && brew cask install react-native-debugger

Step 2: cd into the project && npm i --save-dev react-native-debugger-open

Step 3: Add this to the scripts object in package.json

"scripts": { "postinstall": "rndebugger-open" }

NOTE: This is so that when you click "Remote Debugging" from the devtools menu in your React Native App, it opens React Native Debugger automatically instead of the default which is open debugger-ui with Chrome


If you are using Redux in your project

Step 4: import compose from ‘redux’

Step 5: Paste this in the index file of ya code

const composeEnhancers = window.REDUX_DEVTOOLS_EXTENSION_COMPOSE || compose;

Step 6: create the store like so

const store = createStore(rootReducer, {}, composeEnhancers());

Step 7: If you have middlewares like redux-thunk, do this

const store = createStore(reducers, {}, composeEnhancers(applyMiddleware(ReduxThunk)));

Note: If the react-native-debugger window doesnt pop up upon starting the app. Run npm install again and then proceed to run the app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment