79684632

Date: 2025-06-30 10:41:48
Score: 0.5
Natty:
Report link

When you're pulling data straight from your database within a Server Component and want to send it over to a Client Component, You need to serialise it to turn it into a simple, readable format for the client component.

A common way to do this is by using JSON.parse(JSON.stringify(data))

const property = JSON.parse(JSON.stringify(dbProperty))
<PropertyDetailsClient property={property} />

This flattens the complex database object into something the client component can easily understand.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When you
  • Low reputation (0.5):
Posted by: UncleBigBay