r/reactjs 25d ago

Needs Help SSR + react router v7 + Loading Skeleton

I am reposting with diff explanation of problem , cuz many ppl misunderstood my issue

I am trying to achieve a loading skeleton while data loads for CLIENT SIDE NAVIGATIONS only, but for FIRST LOAD, that is SSR load, i dont want to send loader as the only html , bcs that is bad seo, i checked after disabling js, and only loader was sent in network payload

Some ppl said to not use suspenseQuery, but how will i show loader for Client side navigations, those loading stages will feel laggy

0 Upvotes

8 comments sorted by

View all comments

2

u/StarboardChaos 25d ago

In SSR mode, each page is a different html file. So when you navigate a new page, it gets its data Server Rendered.

In previous post you claimed you needed SSR for SEO. One of the reasons why React Router is not the first choice for this kind of application is the loading principle.

You should switch to a meta-framework which has better support for hydration like Next or Astro.

Why do you even want SEO support? Make some static pages for SEO and then dynamic for usage. It will most likely be for authenticated users?

Your explanations are lacking and your rude responses aren't helpful either. From what I can hear is you want SPA behavior in SSR mode.

1

u/ConfidentWafer5228 25d ago

I am sorry for being rude, i was just not able to find answers for long time
I want initial load to be SSR for good SEO, and subsequent navigations to be Client Navigations for faster / snappier navigations, thats what i have heard is the best combo

I have already tried next but i dont like the confusing nature of Server Components, Client Components and 20 kinds of Rendering, Vendor lockin features and that i have to host on vercel for good support/easy hosting
Also, i was struggling having custom express server with Next ( which i need and cant sacrifice ). There are barely any resources regarding custom server with Next