-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: add TableView codemods #7117
base: main
Are you sure you want to change the base?
Conversation
82cbe8f
to
af847b4
Compare
gonna wait until after release for this one so we can test in more apps |
<TableHeader> | ||
<Column key="test">Test</Column> | ||
<Column title="Blah"> | ||
<Column title="Group 1"> |
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.
I think RAC/S2 doesn't support nested columns yet.
// Ensure we're not replacing the parameter declaration | ||
innerPath.node !== params[0] | ||
) { | ||
// Replace with 'column.id' |
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.
I guess this is sort of an assumption that columns have an id
property? They may not, it could be key
or something computed. Probably won't be able to be 100% accurate here. I guess if we wanted to get fancy we could try to look at the id
(previously key
) prop of the Column
component? e.g. <Column key={column.name}>
and then use column.name
here too.
/** | ||
* Updates the key prop to id. Keeps the key prop if it's used in an array.map function. | ||
*/ | ||
function updateKeyToId( |
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.
Did we not already have something like this for other collection components like Item
?
key
to beid
columns
prop fromTableHeader
to toRow
Row
render function to pass column object, not just key✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: