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

后端 未结 7 776
小蘑菇
小蘑菇 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:57

    You can check global.nativeCallSyncHook

    if (!global.nativeCallSyncHook) {
      console.log("Debug JS Remotely")
    }
    

    see more at: https://github.com/facebook/react-native/commit/417e191a1cfd6a049d1d4b0a511f87aa7f176082

提交回复
热议问题