-
SummaryFor example, I have a blog page where I page load a list. After obtaining data from the server, I use useState to display the blog list. But useState must also be a client-side component, is this beneficial for SEO? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
SEO is not necessarily a property of Server/Client Components. Technically, what you want is bots/crawlers to be able to see your content. Clients Components, as of now, are SSR'd, so bots will see that, including SEO bots/crawlers. There's some nuance, some of the changes you make to that list, for example, by adding or removing inputs to the data client side, won't be discoverable by SEO, right? cuz the bot would need to do those changes in order to see that content. |
Beta Was this translation helpful? Give feedback.
I think you are maybe missing the concept of
Hydration
. The Client Components should be included into the HTML sent by the server.JavaScript is also downloaded, and roughly speaking, hydration happens, by walking the tree, replaying the JavaScript, to know where to attach event handlers and what not. If there's a mismatch here, the dreaded
hydration error
is triggered. Then the JavaScript for effects, is run, and then React goes basically dormant, until state updates happen.