T
TanStack3y ago
rare-sapphire

SEO Friendliness

So I've been using react-query lately and I realized that the prefetched data is stored in JavaScript. Hence, when I disabled JavaScript in browser to test the page's SEO-friendliness, the prefetched data are not rendered. Is this behavior intended or did I miss something? How should I do SEO using react-query?
5 Replies
raw-harlequin
raw-harlequin3y ago
Are you using a framework that supports SSR?
rare-sapphire
rare-sapphireOP3y ago
I'm using Next.js
raw-harlequin
raw-harlequin3y ago
so then you should see the pre-rendered html markup in the page source
rare-sapphire
rare-sapphireOP3y ago
i do see it (the string XXX) in the page source, but it's in the <script> tag instead of in HTML markup
No description
rare-sapphire
rare-sapphireOP3y ago
eh, i think the issue lies in how I render my components rather than in react-query. My bad.

Did you find this page helpful?