react-tweet
react-tweet copied to clipboard
Serialize the tweet to avoid client error
I'm encountering this error
Warning: Only plain objects can be passed to Client Components from Server Components. Classes or other objects with methods are not supported.
{: {lang: "en", reply_count: 9, retweet_count: ..., favorite_count: ..., possibly_sensitive: ..., created_at: ..., display_text_range: ..., entities: ..., id_str: ..., text: ..., user: ..., edit_control: ..., card: ..., isEdited: ..., isStaleEdit: ...}}
A simple fix would be to serialize the tweet like
data={JSON.parse(JSON.stringify(unit))}
and then showing it, in server components?