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

后端 未结 7 784
小蘑菇
小蘑菇 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 19:46

    Check __REMOTEDEV__ in a simple way:

    if(global.__REMOTEDEV__) { console.log('Remote Debug'); }
    

提交回复
热议问题