Tanstack Query Pagination SEO
Hi guys
I have questions it might oot but hopefully it is fine, so i try to build personal blog using nextjs 13.4 app router.
i already implement the pagination with help of tanstack query, but i have a concern regarding the SEO.
1. i know using tanstack query for pagination makes my blog became client side rendering, but how much it will be affecting my SEO?
2. and i heard that google robot uses can do pagination but they prefer website with ending of /page=2, /page=3 and so on
so the questions is, Is it possible to use paginated query and to change end of the link when the user click the 2nd 3rd page and so on?
like:
1st page = localhost/3000
2nd page = localhost/3000/page=2
3rd page = localhost/3000/page=3
2th page = localhost/3000/page=4
and so on.
3. is there any best practices i can follow?
4 Replies
foreign-sapphire•3y ago
I think what you're looking for is query parameters
extended-salmonOP•3y ago
yes i was implemet this for my search implementation, but i'm confuse how to implement it alongside the pagination with tanstack query.
dependent-tan•2y ago
oh, i have same issue
extended-salmon•2y ago
this is not really a react query question, but more about how to manage client side state. the currently selected page is client state. it can be in useState, or you can write to the url and read it with useParams or whatever hook the router exposes.
then pass the value to the queryKey