constructor(props){ super(props); this.state = {text:'125'}; } render(){ return( <View> <Button title='状态' onPress={()=>{ this.setState({text:'7777'}); alert(this.state.text) }}></Button> </View> ); }
constructor(props){ super(props); this.state = {text:'125'}; } render(){ return( <View> <Button title='状态' onPress={()=>{ this.setState({text:'7777'}); alert(this.state.text) }}></Button> </View> ); }