-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(RAC): Expose cell's column index in its render props #9459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
reidbarber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good change.
Two questions for the team:
- Should we also add
colIndex(accounts for when colspans) - Should we add a data attribute?
|
Is there a difference between |
|
Thanks for getting back to me so fast 🥳
|
|
Do we really need cellIndex? it seems a little arbitrary depending on colspans in previous cells. |
No not really, column index seems the much more reliable property. |
|
@snowystinger Updated, to pass the column index. Had to use the cell index as fallback since the Let me know what you think. |
|
Added data attributes like @reidbarber requested :) |
reidbarber
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes #4968
Hey there, I've updated the
<Cell>component to include thecellIndexin its render props.Why?
By passing down the index, we can easily look up the column props
This is super handy for dynamic styling. For example, if you want to align text based on a prop set on the column, you can now grab that config directly inside the cell.
Example Here is how you might use it to handle alignment:
Usage
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: