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•3y ago
Are you using a framework that supports SSR?
rare-sapphireOP•3y ago
I'm using Next.js
raw-harlequin•3y ago
so then you should see the pre-rendered html markup in the page source
rare-sapphireOP•3y ago
i do see it (the string
XXX) in the page source, but it's in the <script> tag instead of in HTML markup
rare-sapphireOP•3y ago
eh, i think the issue lies in how I render my components rather than in react-query. My bad.