yarn add react-native-vdebug
import React from 'react'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import { getRouter } from './config'
import { ErrorBoundary } from '../component/light'
import VDebug, { initTrace, setExternalContext } from 'react-native-vdebug'
import { View } from 'react-native'
const Stack = createNativeStackNavigator()
export default function Router() {
// Before component Render, perform Proxy Console/Network (Optional)
initTrace()
// Context object when the command is executed (Optional)
setExternalContext('your context')
return (
<ErrorBoundary>
<Stack.Navigator initialRouteName="Index">{getRouter()}</Stack.Navigator>
<View>
<VDebug
// Info panel (Optional)
info={{ obj: 'your object' }}
/>
</View>
</ErrorBoundary>
)
}
参考链接:
https://www.npmjs.com/package/react-native-vdebug
标签:vdebug,React,createNativeStackNavigator,setExternalContext,react,import,initTrac From: https://blog.51cto.com/xutongbao/8102475