Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

help: Wait for promise to resolve before client side rendering. #596

Closed
arsy29 opened this issue Jan 9, 2022 · 1 comment
Closed

help: Wait for promise to resolve before client side rendering. #596

arsy29 opened this issue Jan 9, 2022 · 1 comment
Assignees

Comments

@arsy29
Copy link

arsy29 commented Jan 9, 2022

📚 What are you trying to do? Please describe.
Is there a way to wait for API calls or any promise to resolve before loading the page so that it would include details from the API.

🔍 What have you tried?
I tried using useAsync, useFetch, onServerPrefetch but have a problem with redirecting and reloading pages where data is available in some cases, and some render the page blank and just wait for the promise to finish and render the details.

ℹ️ Additional context
I'm creating a landing page where details such as title, images and etc. are being supplied using API.

@danielroe
Copy link
Member

At the moment, we can't block page navigation on client-side using the composition API + Nuxt 2.

On server-side, useFetch or onServerPrefetch should work to block page load on the initial SSR. Perhaps you could share your code if you're finding it's not working for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants