当前位置: 首页 > 工具软件 > Reactotron > 使用案例 >

React-Native reactotron-react-native 网络调试工具安装

丁阳炎
2023-12-01

1:安装插件

yarn add reactotron-react-native --dev

2:根目录添加配置文件ReactotronConfig.js

import Reactotron from 'reactotron-react-native';
Reactotron.configure() // controls connection & communication settings
  .useReactNative() // add all built-in react native plugins
  .connect(); // let's connect!

3:项目初始化位置App.js/index.js中引用配置文件

componentDidMount() {
        if (__DEV__) {
            import('./ReactotronConfig').then(() =>
              console.log('Reactotron Configured'),
            );
        }
    }

4:下载客户端下载地址https://github.com/infinitered/reactotron/releases

5:真机调试需要打开9090端口!adb reverse tcp:9090 tcp:9090

 

 类似资料: