Passing initialData / placeholderData from the server
In the docs, the suggested way to use React-Query on Nextjs App router is by dehydrating and hydrating the query.
For me, that's a bit too much (I am a newbie
- still working of my mental model of...well everything) and I tried a different approach and it seems to work fine.
I just need to know if my approach is ok too, even if it's not the best. This is how I am doing it:
In page.tsx (server component) I get the data
And pass to the component that needs it, and use it when calling my custom hook, where I use it like this:
For me, that's a bit too much (I am a newbie
I just need to know if my approach is ok too, even if it's not the best. This is how I am doing it:
In page.tsx (server component) I get the data
And pass to the component that needs it, and use it when calling my custom hook, where I use it like this: