I am using react native for making an App. I need to wait for ten seconds and then do the redirection in my screen. Here is my code:
onPressEnter() {
setTimeout(onPressEnter(), 5000);
//////Redirecting
changePage("Error");
}
However, either the commands of timeouts that I found shows no, or they gives me an error:
Can not find onPressEnter
I should mention that, this method calls by a button in my screen.
Can you help me how to implement a time out correctly?