Skip to content

feat(frontend): Improve support for nextjs SSR

Arnaud Vergnet requested to merge topic/default/frontend into branch/default

NextJS does the first render on the server. We must make sure to render page skeletons with proper loading indicators on first render, then display the data. This PR introduces the useLoad hook to simulate loading data while we do not have real data. This allows us to properly prepare the UI with static data, so integrating with remote data requires less work.

The same goes with dark mode: localStorage is only available in the client, so the SSR skeleton would always be white, resulting in a white flash on dark mode. The solution is to store the mode in a cookie so the server can properly render the skeleton with the right theme.

Closes #24 (closed)

Edited by Arnaud Vergnet

Merge request reports