react native useState update
I have this : const [debugStr, setDebugStr] = useState("This is a debug string") function debug(str){ setDebugStr(str+'nn'+debugStr) } function testPressed(){ debug("Test1") debug("Test2") } // and later : <Button onPress={() => { testPressed() }} title='Press me' /> <Text>{debugStr}</Text> My problem is that…