T
TanStack•3y ago
genetic-orange

Am I using columnHelper correctly?

When I try to use columnHelper, I am getting a typescript error Expected 2 arguments, but got 1. That said, the code compiles and the page loads.
No description
2 Replies
ambitious-aqua
ambitious-aqua•3y ago
You need a second argument. I believe that
columnHelper.accessor("id", {})
columnHelper.accessor("id", {})
would work. It expects a second argument which is an object that accepts a bunch of different configuration options you can specify such as size, header, enableGlobalFilter etc. etc. With that being said, just an empty object {} would suffice to fix your typescript issues. I think
stormy-gold
stormy-gold•3y ago
The second parameter is an object with a required property id , the rest of the properties are optional 🤗

Did you find this page helpful?