Error: Hydration failed because the initial UI does not match what was rendered on the server Nextjs14

35 Views Asked by At

I have coded a navbar in which there is searchicon, person icon and cart icon. I want to perform this action in nextjs14.

The person Icon will be dynamic based on the auth state. If the user is authenticated it will show the avatar. otherwise it will show the person icon.

After signup with credentials, I am getting this hydration error:

enter image description here

The file is marked with "use client" and My code snippet is:

enter image description here

Thank you for your support

0

There are 0 best solutions below