React native breakpoint debugging

android studio avd emulator

Project created by expo scaffolding

 

Automatically open the browser after clicking 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>
}

The real iPhone can also break point debugging:

Shake the phone to pop up the development menu and select "Debug Remote JS".

 

Guess you like

Origin blog.csdn.net/xutongbao/article/details/122865462