Replies: 2 comments
-
I went to https://stackblitz.com/github/reactive/data-client/tree/master/examples/nextjs?file=pages%2FAssetPrice.tsx and do not see anything in the dev console other than As far as where fetches happen - potentially both! The server does the fetch for initial page load, however, the page remains interactive, so in this case after 2 seconds it will fetch the current price to update it continually using polling. Client-side fetches could also come due to mutations, etc. The point is just that there is no overfetching. There is no need for the client to refetch data it already has, as the store is able to hydrate with the server side load. New data still needs to fetch. If the polling is too confusing, you can try replacing useLive with useSuspense, which will not poll the price continually after load. |
Beta Was this translation helpful? Give feedback.
-
I updated the NextJS demo homepage to have an interactive todolist instead of the live price. This should make the lack of client-side fetching for SSR more obvious. |
Beta Was this translation helpful? Give feedback.
-
Hi all. Where the dataclient fetches should take place by default when used with NextJs - on the server or on the client side? I am checking the included nextjs example, and despite the "No fetch requests took place on the client" statement, i see the requests to api.exchange.coinbase.com in the browser console and a warnings "Fetch appears unhandled - you are likely missing the NetworkManager middleware" for each request.
Beta Was this translation helpful? Give feedback.
All reactions