Last active
June 30, 2023 06:46
-
-
Save 4sskick/ea85fe07b7e30d897c494584a781c690 to your computer and use it in GitHub Desktop.
React Native - Debugging Tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG-ger react native | |
--------------------------- | |
use standalone https://github.com/jhen0409/react-native-debugger (rnDebugger) | |
Mine is use a windows version from release page | |
- run applicaiton of react native as usual | |
- open downloaded file of rnDebugger | |
- open menu developer by type d on terminal or by shaking device | |
- tap on Debug | |
- rnDebugger automatically will detect open port for debug | |
- for first time might be there's error, mine is relate with `invariant-violation-calling-synchronous` bla bla bla~ | |
- fix it by open MessageQueue.js (path: node_modules/react-natives/Libraries/BatchedBridge/) | |
- look on section `callNativeSyncHook` | |
fix by replace whole block with | |
const isDebuggingEnabled = (typeof atob !== 'undefined'); | |
this.processCallback(moduleID, methodID, params, onFail, onSucc); | |
if(!isDebugginEnabled){ | |
return global.nativeCallSyncHook(moduleID, methodID, params); | |
} | |
- save it, and running app will reload automatically | |
- and rnDebugger will run normal | |
credit: | |
https://stackoverflow.com/questions/61067004/invariant-violation-calling-synchronous-methods-on-native-modules-is-not-suppor | |
by default rnDebugger can't inspect networ request and see responds, enable it by edit config file | |
- on active window of rnDebugger see on menu `Debugger` > `Open config file` | |
- scroll to bottom and see for `defaultNetworkInspect` change to true | |
- save and close then re-open |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment