Comments on: Combining React Server Components with react-query for Easy Data Management https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/ Helping Your Journey to Senior Developer Mon, 05 May 2025 18:42:23 +0000 hourly 1 https://wordpress.org/?v=6.9 By: Adam Rackis https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/#comment-27195 Mon, 05 May 2025 18:42:23 +0000 https://frontendmasters.com/blog/?p=2378#comment-27195 In reply to Naeem.

It’s been awhile, but it’s usually best practice to start the fetch for data as high up as you can, and then await it as low as possible, so you minimize the risk of blocking things unnecessarily, while data are in flight.

]]>
By: Naeem https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/#comment-27194 Mon, 05 May 2025 18:33:34 +0000 https://frontendmasters.com/blog/?p=2378#comment-27194 I have checked the code. One question I have is, what is the point of adding the prefetchQuery for books-query in the page.tsx, which is a server component, and down the line doing the same books-query call in Books.tsx? Because, as per my understanding, it will fire the books api query twice, once from page.tsx and then from Books.tsx.

]]>
By: Adam Rackis https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/#comment-10684 Mon, 02 Sep 2024 16:23:13 +0000 https://frontendmasters.com/blog/?p=2378#comment-10684 In reply to Jeff.

Basically, when you call your api endpoints from the server, during ssr, no cookies will be included, since the request is happening in Node, as opposed to from the browser. To fix, you’d have to put all your cookies into React context, which introduces security concerns. The linked library allows you to do that, while encrypting them.

]]>
By: Jeff https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/#comment-10683 Mon, 02 Sep 2024 15:40:56 +0000 https://frontendmasters.com/blog/?p=2378#comment-10683 I don’t understand the update part about making the cookies available on SSR/CSR. is there a complete example somewhere on how one would implement this?

]]>
By: thankyou https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/#comment-5850 Mon, 17 Jun 2024 03:08:51 +0000 https://frontendmasters.com/blog/?p=2378#comment-5850 great article, i have a question
Nextjs app directory version’s client component is being rendered on server first(SSR). if i use useQuery inside client component does it fetch data is serverside?

]]>
By: Glody mbutwile https://frontendmasters.com/blog/combining-react-server-components-with-react-query-for-easy-data-management/#comment-4299 Sat, 25 May 2024 03:24:05 +0000 https://frontendmasters.com/blog/?p=2378#comment-4299 Great article. RSC, routing is server-centric. So, client can’t “see” the next URL before the server responds.

I think as the windows.history won’t attempt to load this URL after a call to pushState() that is why it is not integrated with transitions

]]>