[Data views]: Rename accessorFn to getValue - #55434
Conversation
|
Size Change: +28 B (0%) Total Size: 1.66 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 6a0247e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6557059055
|
| const { render, ...column } = field; | ||
| column.cell = ( props ) => render( props.row.original, view ); | ||
| const { render, getValue, ...column } = field; | ||
| column.cell = ( props ) => |
There was a problem hiding this comment.
We should also cover against field.render not existing, e.g.: status.
There was a problem hiding this comment.
This happens in the parent component: https://github.com/WordPress/gutenberg/pull/55434/files#diff-a72d10c309e831c5e03caff0c1b9cfb82885abb105377a196cca642ea4d711adR32
There was a problem hiding this comment.
ok, that's confusing 😅 Can we normalize both things in the same place?
There was a problem hiding this comment.
A follow-up we may need to do is the following: the tanstack API may use the presence of accessorFn and cell to determine whether a feature is enabled or not
Exactly that. Let's do that in a separate PR and see if we can remove the getValue completely.
oandregal
left a comment
There was a problem hiding this comment.
I left a comment I'd like us to address at https://github.com/WordPress/gutenberg/pull/55434/files#r1363355741 Other than that, it's ready.
A follow-up we may need to do is the following: the tanstack API may use the presence of accessorFn and cell to determine whether a feature is enabled or not. For example, accessorFn is used to determine whether a column is filterable. We'd need to review these tanstack details, so they don't leak into our own API.
What?
Small follow up of: #55411
Renames
accessorFntogetValueand updates the signature to of both to accept an object, so they can be used as components.Testing Instructions