Skip to content
Source
Sign inSign up
TanStack/table

Accessor key does not have the same typing as Form's name key #6302

Send to my agent
ClosedBahnasawy(GitHub profile, opens in a new tab) opened this issue 0 comments

TanStack Table version

v8.21.3

Framework/Library version

React v19.2.7

Describe the bug and the steps to reproduce it

ColumnDef defines accessorKey as

accessorKey: (string & {}) | keyof TData;

Which causes accessorKey not to produce the same suggestions as a form field's name key in tanstack form.

My suggestion is to define accessorKey as

accessorKey: DeepKeys<TData>;

https://www.typescriptlang.org/play/?#code/PTAEHkBsBMCgFMAeAHA9gJwC6gJYDtN50AzAQwGN5QBBcygZ3owGl4BPAYVUgFcBbPABF4xAEKl68ADwAVQaUylQSQnmj1QAJVQB3eYoA0oGQDVSvKgF5QPPAGs8uvAD5liVetBdeA4WInScgqkRqbmPPCuAN6woHG40AD8AFyg9Jjo+ADmANyx8RQMTOisbKkAFOmZeFmgAGSgUQC+AJSgAD6gduyoxMb6pHlNsLAgoABy8DoIKBjY+IQkFFS0RSzs3vxCIuKSsgNuHhraesGhZhag1rYOTq4q8Goam747AftnxhcR0flxOElUlVsnl4qBCvBGOsyqBhPBkKV6B9FM4hkA

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I think I know how to fix it and will discuss it in the comments of this issue

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. KevinVandy closed this

Sign in to join this conversation.