Skip to content

columnHelper.accessor Type issue #4241

@opti21

Description

@opti21

Describe the bug

When defining the columns for the table, columnHelper.accessor seems to cause a type issue. Although, table seems to render fine.

Type error:
Type 'ColumnDef<Room, string>' is not assignable to type 'ColumnDef<Room, unknown>'.

StackBlitz Type Error:

Type instantiation is excessively deep and possibly infinite.(2589)
(property) accessor: <"id", string>(accessor: "id", column: Omit<ColumnDef<Room, string>, "accessorKey">) => ColumnDef<Room, string>

Your minimal, reproducible example

https://stackblitz.com/edit/github-sq9c9a?file=pages%2Findex.tsx

Steps to reproduce

Line 22 on index.tsx

Expected behavior

No type error

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Windows 11 Pro
Chrome: Version 103.0.5060.134 (Official Build) (64-bit)

react-table version

8.5.2

TypeScript version

4.7.4

Additional context

No response

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions