React native - Programmatically check if in remote JS debugging is enabled

后端 未结 7 774
小蘑菇
小蘑菇 2021-02-01 19:04

On React-Native, how can I know if \"Debug JS Remotely\" is enabled?

I tried looking in RN docs and various NPM packages, but couldn\'t find out how...

相关标签:
7条回答
  • 2021-02-01 20:00

    How to programmatically check if remote debugging is enabled (just found this peculiar behaviour today on another SO question). Tested on RN 0.43 and with Chrome debugger + React Native Debugger :

    const isDebuggingEnabled = (typeof atob !== 'undefined');
    

    Edit: just noticed this was asked over half a year ago :D... well, I leave it here for future generations.

    0 讨论(0)
提交回复
热议问题