Replies: 2 comments
-
It seems to me like you might be weighing the tradeoffs of |
Beta Was this translation helpful? Give feedback.
-
There must be some solution to handle it in
Based on The best solution would be, that I pass data down to the page, the page is getting statically rendered and each time further information needs to be fetched, it will be fetched and rendered correctly. So that when a client access the page, he will get a fully rendered page. Ideally I would make the informatio available to |
Beta Was this translation helpful? Give feedback.
-
Currently I have some kind of data fetching for each of my page via
getStaticProps
. This data is provided to the client and my page can get rendered. During render a lot of further data need to get fetched. This are small pieces of data which require an API call. I do this by usinguseSWR
. The problem is that this small pieces are not yet available on the static rendered page. When the server send the page to the client this information is not available, the have to be fetched by the client.What I would actually like to do is, that when the server renders the site, the server also fetches the small pieces of data, so that they are rendered. Then this data need somehow to be collected in a store and needs to be send to the client, so that the client do not need to fetch them. Actually this is how I solved this issue with another framework. All the data is fetched on the server and then I send it as part of the fully rendered page to the client, after hydration the client pick ups the data and stores it in a redux store.
What would be a good approach to do this in Next.js?
Beta Was this translation helpful? Give feedback.
All reactions