Replies: 1 comment 9 replies
-
TableFactory takes partial generics too
https://github.com/TanStack/react-table/blob/f10003b398be44d2f85e94874b7c8d307b464754/packages/table-core/src/createTable.tsx#L46
Tanner Linsley
…On Mar 30, 2022, 12:54 PM -0700, Sebastian Obentheuer ***@***.***>, wrote:
I am testing @tanstack/react-table: 8.0.0-alpha.11, which works great so far.
Now, I try to create a reusable Table component for my app that encapsulates most of react-table.
I have a hard time to get the typings right, could you give me a hint @tannerlinsley?
Also, I am not sure if I understand the API right but: it seems that I have to pass all three props? (since table is needed to create columns outside the component and needed in the useTable hook inside the component?).
So far I got this:
interface Props<T> {
table: TableFactory<T>;
data: T[];
columns: ColumnDef<Partial<DefaultGenerics>>[];
}
export const SuperTable = <T extends object>(props:Props<T>) => {
// ...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am testing
@tanstack/react-table: 8.0.0-alpha.11
, which works great so far.Now, I try to create a reusable Table component for my app that encapsulates most of react-table.
I have a hard time to get the typings right, could you give me a hint @tannerlinsley?
Also, I am not sure if I understand the API right but: it seems that I have to pass all three props? (since
table
is needed to createcolumns
outside the component and needed in theuseTable
hook inside the component?).So far I got this:
Beta Was this translation helpful? Give feedback.
All reactions