Best practices with useAsyncData and route blocking
Hello, I'm really struggeling with right aproach of SSR and data fetching. I'm fetching data from API in useAsyncData, but I have NuxtLayout inside app.vue. So the result is layout is loaded, but page is empty untill useAsyncData is finished. It can be solved by putting NuxtLayout inside pages instead of app. But then it hase sometimes wierd behiviour. For example if I press back button in browser, its switch the route imidiatly and then for a few moments there is a content from the old page. How to solve this issue or what is the right aproach? If better way is to not block the route, what is the best practice to show loader on client side redirect but render data on SSR. Thanks for any advices.
0 Replies