How to do logging in React Native?

skyline75489 picture skyline75489 · May 8, 2015 · Viewed 293.4k times · Source

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

Answer

Martin Konicek picture Martin Konicek · Jun 27, 2016

Use console.log, console.warn etc.

As of React Native 0.29 you can simply run the following to see logs in the console:

$ react-native log-ios
$ react-native log-android