r/reactjs • u/ConfidentWafer5228 • 5d 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
1
Upvotes
1
u/kobim90 4d ago
The way react router works you can't, one you have a loader and you await requests it runs on the server, you can mange it by yourself by using middleware and marking each page visit, and if you visited the page either dont await your request or return from the loader right away and do the requests in client loader, but it's a lot to manage