onpress not working with usestate react native code example
Example 1: onpress not working with usestate react native
<View style={styles.container}>
<Text>{outputText}</Text>
<Button title="Change text" onPress={() => setoutputText('Open up App.js to start working on your app!')}></Button>
{/* <StatusBar style="auto" /> */}
</View>
Example 2: how to use hooks react
const App = () => {
const [students , setStudents] = useState([]);
return (
// put in the jsx code here
)
}