How do you debug React Native?

后端 未结 30 2711
无人共我
无人共我 2020-11-27 10:19

How does one debug their React code with React Native while the app is running in app simulator?

30条回答
  •  独厮守ぢ
    2020-11-27 10:28

    You can use Safari to debug the iOS version of your app without having to enable "Debug JS Remotely", Just follow the following steps:

    1. Enable Develop menu in Safari: Preferences → Advanced → Select "Show Develop menu in menu bar"
    2. Select your app's JSContext: Develop → {Your Simulator} → Automatically Show Web Inspector for JS JSContext
    3. Safari's Web Inspector should open which has a Console and a Debugger
    

提交回复
热议问题