Skip to content

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

@Bahnasawy

Description

@Bahnasawy

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>;

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions