B
B
belyy_lis2021-09-24 13:47:15
Data synchronization
belyy_lis, 2021-09-24 13:47:15

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

1 answer(s)
K
Kirill Makarov, 2021-09-26
@kirbi1996

Promises to help

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question