Next.js Discord

Discord Forum

Client components only if backend is not nextjs?

Unanswered
Glaucous Gull posted this in #help-forum
Open in Discord
Glaucous GullOP
Hey,

I'm super new to nextjs, can I have your thoughts on this:

I'm not using next for backend stuff. I have a separate backend built in X technology with which I communicate via xhr requests.

Since client components are still SSR-ed, it doesn't make sense to use server components since all they would do is forward the request to my other backend.

That being said, I go with the app router and mark most of my pages with "use client".

Am I missing something?

1 Reply

American
Hello! I'm new to the technology as well, but I think there are several advantages u get using server components apart from data fetching: caching (including request memoization, full route cache) and seo optimization. Might be missing some other features, but these two are quite useful.

By the way, if client components, such as in pure react, are SSR-ed, does it mean that browser's search robots get all the text and tags on my page? (without running any js files)
I thought that in production, using pure react, we have plain html and js bundle that loads all the tags, text, styling and interactivity. But if client components are SSR-ed by default, then in build folder we should have some content in .html file, which is not the case. I'm confused what means "client components are still SSR-ed" and are there any advantages with SEO using Nextjs server components. I should've create another thread for that, but the context would be lost