Kid
Kid

Reputation: 2215

Why is the props not passed to my Component in this beginner question

Beginner question!
As you see on the image the ratio, background all 4 have values in them but when I pass them to Itemrender like this:

<Component aaa={(ratio, background, fileData, id, week)} />

And when ItemRenderer receive them the aaa is only "1"

enter image description here

Here is Itemrender and the aaa = "1"

enter image description here

Upvotes: 0

Views: 23

Answers (1)

David
David

Reputation: 219057

Perhaps the value for week is "1"? This syntax looks wrong to me:

aaa={(ratio, background, fileData, id, week)}

It looks like it's effectively just passing the last value. If you want to pass them all as an object, use the object literal {} syntax:

aaa={{ratio, background, fileData, id, week}}

Upvotes: 1

Related Questions