Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Refresh Grid

Compare
Choose a tag to compare
@geoperez geoperez released this 19 Aug 18:42
· 206 commits to master since this release

This is a proposal to include ability to refresh the grid. The approach I'm taking is providing a deps prop that can be provided to the useDataGrid hook, so that any relying party can have control over the refresh on the grid.

In order to implement this functionality you just need to create the dependency, for example:

// The refresh is for the deps prop and the forceRefresh method
// will be the one to call to make the grid execute the refresh method
const [refresh, forceRefresh] = useGridRefresh();

const forceGridRefresh = () => {
  forceRefresh();
};

<button onClick={forceGridRefresh}>Force refresh</button>
<DataGrid
  ...
  deps={[refresh]}
/>