153
rated 0 times
[
157]
[
4]
/ answers: 1 / hits: 9671
/ 3 Years ago, sat, february 27, 2021, 12:00:00
Is there any way where I can pass in multiple values in a single prop?
Right now how it works is I have one component and it takes in lots of values like this:
<div>
<MyComponent
valueA={100}
valueB={90}
valueC={80}
valueD={70}
valueE={60}
/>
</div>
Here for example A and B are related and I want to pass them together like
<div>
<MyComponent
valueAB={100, 90}
valueC={80}
valueD={70}
valueE={60}
/>
</div>
It probably needs to be in a single object like this: valueAB={{100, 90}}
but I have no idea.
How can I do this and extract both of the values on the other side?
More From » html