如何登录 React Native [英] How to do logging in React Native

查看:27
本文介绍了如何登录 React Native的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 React Native 中记录变量,例如在为 Web 开发时使用 console.log?

How can I log a variable in React Native, like using console.log when developing for web?

推荐答案

console.log 有效.

默认情况下,在 iOS 上,它会记录到 Xcode 内的调试窗格.

By default on iOS, it logs to the debug pane inside Xcode.

在 iOS 模拟器中,按 (+D) 并按远程 JS 调试.这将在本地主机上打开一个资源 http://localhost:8081/debugger-ui.从那里,使用 Chrome 开发者工具 JavaScript 控制台查看 console.log

From the iOS simulator, press (+D) and press Remote JS Debugging. This will open a resource, http://localhost:8081/debugger-ui on localhost. From there, use the Chrome Developer tools JavaScript console to view console.log

这篇关于如何登录 React Native的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆