import 'react-native-gesture-handler'; import React from 'react'; import { StyleSheet, Text, View, TouchableOpacity, Body, Header, Title } from 'react-native'; function changeText(){ console.log("PIPPO"); } export default class App extends React.Component{ state = {buttonText:"BUTTON 2", accessible:true} changeText(){ this.setState({buttonText:"PIPPO2"}) } hideFocus(){ console.log("Button clicked") this.setState({accessible:false, buttonText:"BUTTON 2: I am no more focusable"}) } render(){ return ( <> RNChangeFocus this.hideFocus()} > Press to make BUTTON 2 unfocusable BUTTON 1 {this.state.buttonText} ); } } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, button: { alignItems: 'center', backgroundColor: '#DDDDDD', padding: 10, marginBottom: 20, }, header: { backgroundColor: '#008577', paddingHorizontal: 20, paddingVertical: 20, marginTop: 20, }, headerText: { color: 'white', }, });