How to do logging in React Native?

前端 未结 30 3562
不思量自难忘°
不思量自难忘° 2020-11-30 17:08

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

30条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-30 17:40

    There is normally two scenarios where we need debugging.

    1. When we facing issues related to data and we want to check our data and debugging related to data in that case console.log('data::',data)

      and debug js remotely is the best option.

    2. Other case is the UI and styles related issues where we need to check styling of the component in that case react-dev-tools is the best option.

      both of the methods mention here.

提交回复
热议问题