Not 100% if it is applicable in your situation, but in case if we have a SSR NextJS component and it need to show a skeleton while this component is in the loading state, we can simply define a loading.js (jsx/tsx) file and show what we need to show.
The doc is here: https://nextjs.org/docs/app/building-your-application/routing/loading-ui-and-streaming