Getting crazy hydration Error
Unanswered
Yellowhead catfish posted this in #help-forum
Yellowhead catfishOP
This image is what it showed me in the browser. Im not sure what im doing wrong in my code base, GPT also doesn't know how to fix this??
What should i do? what is causing this?
What should i do? what is causing this?
6 Replies
Yellowhead catfishOP
Yellowhead catfishOP
there are 2 files i have: navbar.tsx file && navbar-links.tsx file:
the files are too big to crt-C and ctr-V, so i attached the files...
the files are too big to crt-C and ctr-V, so i attached the files...
Goal: Trying to get rid of this error.
-> Looks like there is an inconsistency in the way server components and client components are being rendered, and i think a server component is being rendered twice.
-> Looks like there is an inconsistency in the way server components and client components are being rendered, and i think a server component is being rendered twice.
Yellowhead catfishOP
FIXED IT!!
i was getting searchParams incorrectly from the server.
but i have a question: is it better to use useSearchParams on client side or server side searchParams??
i was getting searchParams incorrectly from the server.
but i have a question: is it better to use useSearchParams on client side or server side searchParams??
@Yellowhead catfish FIXED IT!!
i was getting searchParams incorrectly from the server.
but i have a question: is it better to use useSearchParams on client side or server side searchParams??
depends on the usage, they are both good, but do remember that data always travel from server -> client. if u need searchpram in the server then server-side searchparam. but if u dont need, then u can use useSearchParams