Next.js Discord

Discord Forum

Passing array data from server page to client component

Answered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
So i'm fetching data from supabase in a server side page and trying to pass it down to a client component. However I don't know why the data is passed differently?

Would appreciate the help on how to pass the data correctly if I'm doing something wrong
Answered by Northeast Congo Lion
i missed the brackets for the props
View full answer

4 Replies

Southeastern blueberry bee
hi @Northeast Congo Lion i dont see any error in your screen
@Southeastern blueberry bee hi <@110689630906531840> i dont see any error in your screen
Northeast Congo LionOP
i'm fetching 2 data onto 2 variables "weapons" and "weapon_skills" in the server side page and passing into a client component. I have also checked that both "weapons" and "weapon_skills" are Arrays.

In the client component i'm console logging it, and somehow it shows that my "weapons" variable have both array in an object, not an array, while "weapon_skills" is an empty object, not even an empty array

I don't think it should work this way unless somehow i'm messing up passing the data
Northeast Congo LionOP
ok wait sorry, i'm dumb
Northeast Congo LionOP
i missed the brackets for the props
Answer