Guest User

Untitled

a guest
Dec 11th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. -install react-native-debugger vai hoomebrew:
  2. brew update && brew cask install react-native-debugger
  3.  
  4. -install redux-devtools-extension
  5. npm install --save redux-devtools-extension
  6.  
  7. -in package.json => object "scripts", by replacing PORT with your react native runnning port. by default it's 8081
  8. "scripts":{
  9. ....
  10. "debug" : "open 'rndebugger://set-debugger-loc?host=localhost&port=PORT'"
  11. }
  12.  
  13. -in the JS class where "STORE" is set up, in my example : App.js
  14. #import section
  15. import { createStore, applyMiddleware} from 'redux';
  16. import { composeWithDevTools } from 'redux-devtools-extension';
  17.  
  18. #in createStore function
  19. const store = createStore(reducers, composeWithDevTools(applyMiddleware()));
  20.  
  21. #### in Action
  22. -start react native app:
  23. react-native run-ios
  24. Or
  25. react-native run-android
  26.  
  27. -Enable Debug Remote debuggin
  28. In running application, in My example - simulator
  29. with ⌘D in IOS, Or ⌘M in Android
  30. Click "Debug Js Remotely"
  31.  
  32. -Rux "debug"
  33. in terminal, natigate to the project root.
  34. run:
  35. npm run debug
  36.  
  37. The React native debugger should appear and connected to port 8081, and Redux State should also be connected.
  38. DONE
Add Comment
Please, Sign In to add comment