You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I've been trying to figure this out for about 2 days now to no avail, to the point I am about to reach insanity. Also forgive me if I use the wrong terminology, I'm very new to this and to JS in general.
What I'm trying to do, which at this point I'm not even sure if it's possible / makes sense, is to be able to retrieve the values of any custom prop that I pass with getRowProps() or getCellProps().
For example, imagine that when defining the table markup, I pass row props like this:
// ...<tbody{...getTableBodyProps()}>{rows.map((row)=>{prepareRow(row);return(<tr{...row.getRowProps({banana: 'yellow',onClick: ()=>(console.log(row.banana)),// I want to print the value of 'banana'},)}>{...}</tr>)}}</tbody>// ...
I tried using row.getRowProps().banana, but to no avail, so I guess that I haven't really understood what getRowProps() does, as well as I haven't been able to solve my problem yet.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I've been trying to figure this out for about 2 days now to no avail, to the point I am about to reach insanity. Also forgive me if I use the wrong terminology, I'm very new to this and to JS in general.
What I'm trying to do, which at this point I'm not even sure if it's possible / makes sense, is to be able to retrieve the values of any custom prop that I pass with
getRowProps()
orgetCellProps()
.For example, imagine that when defining the table markup, I pass row props like this:
I tried using
row.getRowProps().banana
, but to no avail, so I guess that I haven't really understood whatgetRowProps()
does, as well as I haven't been able to solve my problem yet.Any help or info is much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions