-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Column with null values causes crashes with some filter modes #39
Comments
Possible workaround: function getNullableStringAccessor<TData extends object>(key: keyof TData) {
return (item: TData) => item[key] || ''
}
const columns = [
{
header: 'Office',
accessorFn: getNullableStringAccessor('officeLocation'),
}
] But I think it might affect other functionality like |
TanStack Table hates null values. This is pretty much the official pattern you should use. const columns = [
{
header: 'Office',
accessorFn: (row) => row.office ?? '',
}
] |
So we close this issue as won't fix, right? |
TanStack Table itself may have some fixes in the future |
Closing since it is upstream issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mantine-react-table version
1.0.0-beta.2
react & react-dom versions
18.2.0
Describe the bug and the steps to reproduce it
Data set with
string
column but it may containnull
values.Define column with just
accessorKey
.enableColumnFilters
andenableColumnFilterModes
on table.Try to enable filter other than
fuzzy
on column withnull
values.Minimal, Reproducible Example - (Optional, but Recommended)
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms
The text was updated successfully, but these errors were encountered: