Fetch user data in router, before component initialization #255
Answered
by
DamianOsipiuk
filipbekic01
asked this question in
Q&A
-
Hello there, I want to fetch user data using vue-query before vue-router enters component. When I try to use query it says hooks can't be used before component is instanciated. Any suggestions? |
Beta Was this translation helpful? Give feedback.
Answered by
DamianOsipiuk
Oct 4, 2022
Replies: 1 comment 1 reply
-
I think you have two options:
Depending on the data type and use-case |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
filipbekic01
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you have two options:
https://vuejs.org/guide/built-ins/suspense.html
https://github.com/DamianOsipiuk/vue-query/tree/main/examples/suspense/src
Depending on the data type and use-case