I'm having a hell of a time figuring this out. I'm using Next 13 and in multiple cases I'm triggering this error. Please help me determine if this is the right way to approach things.
In one case, I am loading a Material UI table on a page. This is how I have it set up:
I have a getClientDetails.js server component that pulls the data from the DB via Prisma like this const clientProjects = await getClientProjects(params.id);
I have a clientProjectTable.js client component which builds the table
In page.tsx I execute getClientDetails then pass the array to clientProjectTable to build the table like this <ClientProjectTable value={clientProjects} />
Every time the table renders on the page, I get the hydration error.
In the console I also get the message Warning: Only plain objects can be passed to Client Components from Server Components. Date objects are not supported.
The same issue is happening on the page where I'm loading the Auth.js login form. As the form loads, I get the same hydration error.
Am I misunderstanding something fundamental here?
I've spent hours trying to figure this out, any help you can provide is appreciated.