fix(table-core): narrow types for columns created by ColumnHelper#5424
Merged
KevinVandy merged 3 commits intoTanStack:mainfrom Mar 28, 2024
Merged
fix(table-core): narrow types for columns created by ColumnHelper#5424KevinVandy merged 3 commits intoTanStack:mainfrom
KevinVandy merged 3 commits intoTanStack:mainfrom
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 6976965. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
2 tasks
KevinVandy
approved these changes
Mar 28, 2024
|
Hello everyone, While this works with helper.accessor({}).accessorKey, it doesn't seem to work for something like this const columns: ColumnDef<T>[] = [
helper.accessor('example' ,{ example})
...
]
columns.map(c => c.accessorKey)
Error:
Property 'accessorKey' does not exist on type 'ColumnDef<TData>'.
Property 'accessorKey' does not exist on type 'ColumnDefBase<TData, unknown> & StringHeaderIdentifier'.My use case here is that I pass columns as props for a wrapper component of the table and I have some options where I need to access the accessorKey of the columns Sorry for bad english |
Contributor
Author
|
@edgarbagagem try typing the columns
|
This was referenced May 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5423
Updates return type of the columns created by