clauderic / clauderic/react-sortable-hoc

Unable to wrap react-virtualized Table with TypeScript.

Open
#445 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.9k
Forks
959
PR merge metrics
No merged PRs in 30d

Description

When I attempt to create a sortable table following [this](https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md#headerrowrenderer) example, I receive the following TypeScript error: `TS2345: Argument of type 'typeof Table' is not assignable to parameter of type 'WrappedComponent>'.   Type 'typeof Table' is not assignable to type 'WrappedComponentFactory>'.     Type 'typeof Table' provides no match for the signature '(props: TableProps<{}>): Element'.`

example:

import { Table } from 'react-virtualized';
const SortableTable = SortableContainer(Table);

This also happens with Ant Design's Table component as well.

react: 16.6.3
react-virtualized: 9.21.0
@types/react-vritualized: 9.18.9
react-sortable-hoc: 0.8.3
@types/react-sortable-hoc: 0.6.4

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the SortableContainer(Table) usage from the linked Table headerRowRenderer example and reproduce the TypeScript error using the listed package versions. Inspect the component typings involved in wrapping react-virtualized and Ant Design Table. Done means the sortable wrapper compiles for these table components without TS2345.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.