Answer the question
In order to leave comments, you need to log in
How to sequentially call functions in onPress React Native?
In onPress
1. Returns a string
2. Changes the state message
3. Displays a modal with message
Now the modal crashes with an empty value, we need to make sure that they are called sequentially. Help, I'm already boiling, I can't think of it.
onPress={() => {
const message = returnStr();
setMessage(message);
setIsOpenModal(true);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question