Best user data fetching practice for protected pages?
Answered
Peterbald posted this in #help-forum
PeterbaldOP
Currently I have some pages that only authenticated users can visit. But since I need to fetch the user to render some of the data, my current approach is responding with a loading ui (that covers the whole screen) and transitions to the actual UI after the data is loaded (serverside suspense).
Is it better to just skeleton parts of the app and render as much as possible of the "UI" portions of the page? But I don't see how that helps the user navigate, as all the interactive components will be disabled and the actual useful user data will be suspended anyways.
Is it better to just skeleton parts of the app and render as much as possible of the "UI" portions of the page? But I don't see how that helps the user navigate, as all the interactive components will be disabled and the actual useful user data will be suspended anyways.
Answered by B33fb0n3
I like to load the basic layout of the page if there are many elements. Like that the user knows, which elements are the most important ones and you can show the user a basic layout from your page.
If you make everything as skeleton loading (so every element on the complete page) it can be confusing for the user, because there are soooo many elements. So focus on the important elements
If you make everything as skeleton loading (so every element on the complete page) it can be confusing for the user, because there are soooo many elements. So focus on the important elements
3 Replies
@Peterbald Currently I have some pages that only authenticated users can visit. But since I need to fetch the user to render some of the data, my current approach is responding with a loading ui (that covers the whole screen) and transitions to the actual UI after the data is loaded (serverside suspense).
Is it better to just skeleton parts of the app and render as much as possible of the "UI" portions of the page? But I don't see how that helps the user navigate, as all the interactive components will be disabled and the actual useful user data will be suspended anyways.
I like to load the basic layout of the page if there are many elements. Like that the user knows, which elements are the most important ones and you can show the user a basic layout from your page.
If you make everything as skeleton loading (so every element on the complete page) it can be confusing for the user, because there are soooo many elements. So focus on the important elements
If you make everything as skeleton loading (so every element on the complete page) it can be confusing for the user, because there are soooo many elements. So focus on the important elements
Answer
@Peterbald solved?
@B33fb0n3 <@763854419484999722> solved?
PeterbaldOP
yeah so I just used a discord-like approach, I load the user state with a screen overlay and for other contents I am using skeletons