Skip to content

Commit

Permalink
fix(Grid): fixes extra white-space on page change
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-kumawat committed Sep 1, 2020
1 parent d054f2c commit f22f626
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions core/components/organisms/grid/MainGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const MainGrid = (props: MainGridProps) => {
showHead,
draggable,
withCheckbox,
data
data,
page
} = _this.props;

const classes = classNames({
Expand All @@ -42,11 +43,17 @@ export const MainGrid = (props: MainGridProps) => {
tight: 24
};

const [state, setState] = React.useState({
const initialState = {
offset: 0,
avgRowHeight: minRowHeight[size],
inView: 20
});
};

const [state, setState] = React.useState(initialState);

React.useEffect(() => {
setState(initialState);
}, [page]);

const {
offset,
Expand Down

0 comments on commit f22f626

Please sign in to comment.