-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Table API to only require a single top-level component #1108
Labels
Comments
FYI I've just updated a project ( <Table
className="vertical-align"
defaultRowHeight={32}
defaultColumnWidth={224}
enableColumnResizing={false}
enableRowHeader={false}
numRows={data.length}
>
<Column cellRenderer={this.renderCell} name={keyColumnName} />
<Column cellRenderer={this.renderCell} name={valueColumnName} />
</Table> The error:
|
P2 for 4.5 years. woot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now, tables must be constructed using an API like this:
This works fine for static tables like the ones in the docs site and examples page, but it's not great for applications that have dynamic numbers of columns. The compiler doesn't do a good job of type inference when it comes to React children. I can't even do something like this:
This fails with:
Another thing this refactor opens up is easier API support for merged cells / headers / etc. Why I wrote React-Table ... is a good read for understanding these API decisions.
This does not mean we remove components like
<Cell>
and<ColumnHeader>
; those are still useful for providing default implementations of certain renderers used in the table.Discussed offline with @gscshoyru and @cmslewis
The text was updated successfully, but these errors were encountered: