Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -install react-native-debugger vai hoomebrew:
- brew update && brew cask install react-native-debugger
- -install redux-devtools-extension
- npm install --save redux-devtools-extension
- -in package.json => object "scripts", by replacing PORT with your react native runnning port. by default it's 8081
- "scripts":{
- ....
- "debug" : "open 'rndebugger://set-debugger-loc?host=localhost&port=PORT'"
- }
- -in the JS class where "STORE" is set up, in my example : App.js
- #import section
- import { createStore, applyMiddleware} from 'redux';
- import { composeWithDevTools } from 'redux-devtools-extension';
- #in createStore function
- const store = createStore(reducers, composeWithDevTools(applyMiddleware()));
- #### in Action
- -start react native app:
- react-native run-ios
- Or
- react-native run-android
- -Enable Debug Remote debuggin
- In running application, in My example - simulator
- with ⌘D in IOS, Or ⌘M in Android
- Click "Debug Js Remotely"
- -Rux "debug"
- in terminal, natigate to the project root.
- run:
- npm run debug
- The React native debugger should appear and connected to port 8081, and Redux State should also be connected.
- DONE
Add Comment
Please, Sign In to add comment