question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Property 'getResizerProps' does not exist on type 'HeaderGroup<object>'

See original GitHub issue

Describe the bug (required) getResizerProps() property does not work when using TypeScript with @types/react-table@7.0.26

Steps To Reproduce (required)

  
    const tableInstance = useTable(
        { columns, data },
        useBlockLayout,
        useResizeColumns,
    );
        
    const {
        getTableProps,
        headerGroups,
    } = tableInstance;
    
return (
    // apply the table props
   <div {...getTableProps()} className="table">
       <div className="table-header">
           {
               headerGroups.map(headerGroup => (
                   <div {...headerGroup.getHeaderGroupProps()} className="table-header-row">
                        { headerGroup.headers.map(column => (
                            <div {...column.getHeaderProps()} className="th">
                            {column.render('Header')}
                            <div
                              {...column.getResizerProps()} //Property 'getResizerProps' does not exist on type 'HeaderGroup<object>'.  TS2339
                            />
                          </div>
                        ))}
                   </div>
               ))
           }
       </div>
   </div>
  )

Expected behavior (Recommended)

getResizerProps should exist on column

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

7reactions
oltodocommented, Jul 6, 2021

Simply add the bellow lines in a .d.ts file:

import { UseResizeColumnsColumnProps } from "react-table";

declare module "react-table" {
  export interface ColumnInstance<
    D extends Record<string, unknown> = Record<string, unknown>
  > extends UseResizeColumnsColumnProps<D> {}
}
3reactions
github-actions[bot]commented, Apr 8, 2022

This issue is being marked as stale (no activity in the last 14 days)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Property 'getResizerProps' does not exist on type ... - GitHub
Describe the bug (required) getResizerProps() property does not work when using TypeScript with @types/react-table@7.0.26 Steps To Reproduce ...
Read more >
Developers - Property 'getResizerProps' does not exist on type ...
Describe the bug (required) getResizerProps() property does not work when using TypeScript with @types/react-table@7.0.26.
Read more >
react-table and TypeScript: how do custom properties on ...
TypeScript complains about these two properties that I've added to columns : Property 'className' does not exist on type 'ColumnInstance<object> ...
Read more >
property 'classname' does not exist on type 'eventtarget'.
Typescript :Property 'className' does not exist on type 'EventTarget' ... One way to fix this error is to type cast the target object...
Read more >
React-table 7 Tutorial - Medium
headerGroups is an object that contains an array of headers and decorators getHeaderGroupProps and getFooterGroupProps.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found