So i am new to React native and typescript. I can't seem to find any way to print something on the page of my app, after a button is pressed.
Here is my function that is called:
const getDuck = () =>{ const number = Math.floor(Math.random()*5000 + 1) alert(number) return <Text>{number}</Text> }
And here is where i am calling it:
return(<View style={{flex: 1, justifyContent: "center", margin: 8}}><Text>Random number</Text><Button title="Press me" onPress={() => getDuck()} color="#32a852" /></View> )