ReactNativeブレークポイントのデバッグ

androidstudioavdエミュレーター

博覧会の足場によって作成されたプロジェクト

 

debug remote jsをクリックした後、ブラウザを自動的に開きます。

App.js:

import React, { useState } from 'react';
import { View, TextInput, Text} from 'react-native'

export default function App() {
  const [username, setUsername] = useState('admin')

  const handleInput = (e) => {
    console.log(e)
    setUsername(e)
  }

  return <View>
    <Text>Hello</Text>
    <TextInput value={username} onChangeText={handleInput}></TextInput>
    <Text>{username}</Text>
  </View>
}

実際のiPhoneは、ポイントデバッグを中断することもできます。

電話を振って開発メニューをポップアップし、「DebugRemoteJS」を選択します。

 

おすすめ

転載: blog.csdn.net/xutongbao/article/details/122865462