Skip to content

[1] Context passing table#12

Open
MohitPatel1 wants to merge 2 commits intoteziapp:mainfrom
MohitPatel1:context-passing-table
Open

[1] Context passing table#12
MohitPatel1 wants to merge 2 commits intoteziapp:mainfrom
MohitPatel1:context-passing-table

Conversation

@MohitPatel1
Copy link
Member

No description provided.

@MohitPatel1 MohitPatel1 changed the title Context passing table [1] Context passing table Apr 27, 2025
Comment on lines +63 to 65
"dependencies": {
"react-icons": "^5.5.0"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt this be dev-dependency?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, updating

Comment on lines +22 to +26
tableProps: Omit<MaterialReactTableProps<T>, 'columns' | 'data'> & {
columns: MRT_ColumnDef<T>[];
data: T[];
},
table?: MRT_TableInstance<T>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its either of both right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, updating

},
table?: MRT_TableInstance<T>
}) => {
const { columns, data, ...tablePropsWithoutColumnsAndData } = tableProps;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove columns, data, seperately?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changing

Comment on lines +47 to +56
state={table.getState()}
columns={table.options.columns}
data={table.options.data}
enableColumnFilters={table.options.enableColumnFilters}
enableGlobalFilter={table.options.enableGlobalFilter}
enableColumnOrdering={table.options.enableColumnOrdering}
enableGrouping={table.options.enableGrouping}
enablePagination={table.options.enablePagination}
enableSorting={table.options.enableSorting}
// Add more table props as needed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the hell is this!?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passing table = {table} is overriding the pdf button and other props we pass.

This way buttons are showing, but from table actions we can't change table state, it has to be done via api.

How to solve this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

passing table = {table} is overriding the pdf button and other props we pass.

This way buttons are showing, but from table actions we can't change table state, it has to be done via api.

How to solve this?

@MohitPatel1 MohitPatel1 requested a review from krishna-404 April 27, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants