Skip to content

Commit

Permalink
Merge pull request #273 from komarovalexander/dev
Browse files Browse the repository at this point in the history
data is reacting on property change in uncontrolled mode
  • Loading branch information
komarovalexander authored Jan 22, 2023
2 parents 1676752 + 09ac463 commit de97aea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ka-table",
"version": "7.8.2",
"version": "7.8.3",
"license": "MIT",
"repository": "github:komarovalexander/ka-table",
"homepage": "https://komarovalexander.github.io/ka-table/#/overview",
Expand Down
5 changes: 4 additions & 1 deletion src/lib/Components/TableUncontrolled/TableUncontrolled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ export const TableUncontrolled: React.FunctionComponent<ITableUncontrolledProps>
if (props?.loading?.enabled !== tablePropsUncontrolled?.loading?.enabled) {
props?.loading?.enabled ? contextTable.showLoading() : contextTable.hideLoading();
}
if (props?.data !== tableProps?.data) {
contextTable?.updateData(props?.data || []);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props?.loading?.enabled]);
}, [props?.loading?.enabled, props?.data]);

return (
<TableInstanceContext.Provider value={contextTable}>
Expand Down

0 comments on commit de97aea

Please sign in to comment.