FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

react-table 2.22.19 typing issue · Issue #3172 · patternfly/patternfly-react · GitHub

react-table 2.22.19 typing issue #3172

Description

In version 2.22.19 of react-table, which seems to be the latest at the time of writing, the sample found at this link is generating errors when building: https://www.patternfly.org/v4/documentation/react/components/table/#table-with-width-modifiers

The error is:

error TS2322: Type '(() => { className: string; })[]' is not assignable to type '((label?: (string & { title?: ReactNode; props?: any; }) | (object & { title?: ReactNode; props?: any; }) | (ComponentClass<any, any> & { title?: ReactNode; props?: any; }) | (FunctionComponent<any> & { ...; }) | undefined, rowData?: IRowData | undefined, columnIndex?: number | undefined, column?: IColumn | undefine...'.

168         transforms: [cellWidth(70)],
            ~~~~~~~~~~

Indeed, apparently, the transforms attribute of ICell is typed as ITransforms as seen in this code:

export interface ICell {
title?: string | React.ReactNode;
transforms?: ITransforms;
cellTransforms?: ITransforms;
columnTransforms?: ITransforms;
formatters?: IFormatters;
cellFormatters?: IFormatters;
props?: any;
data?: any;
header?: any;
cell?: any;
dataLabel?: string;
}

But the cellWidth transform does not comply with that interface, so, typescript transpiler fails with error.

I think types/interfaces should be fixed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL