How to test loading state from useNavigation() hook in v6? #9715
Unanswered
olga-urentseva
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Have a good day!
I'm trying to test my component, that should show
<Spinner>
when thestate
fromuseNavigation()
is "loading". But I don't understand how to emulate this situation.Example:
... I see that
state === "idle"
at first, only then it'sloading
and thenidle
again, so my<Spinner>
that exists only whenstate === "loading"
can not be catched and tested. And that’s understandable in this case, but I don't know how to catch the moment when thestate === "loading"
. I'm trying to find the solution for a week already...I'd be super happy for your answers! 🥲
Beta Was this translation helpful? Give feedback.
All reactions