Skip to content

Commit

Permalink
fix(Pagination): stories controls (#1281)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirik authored Jan 29, 2024
1 parent 60357cd commit a6fac44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/Pagination/__stories__/Pagination.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ import {Pagination, PaginationProps} from '../../Pagination';

const useState = (args: PaginationProps) => {
const [state, setState] = React.useState({...args});

const onUpdate: PaginationProps['onUpdate'] = (page, pageSize) =>
setState((prevState) => ({...prevState, page, pageSize}));

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

return {...state, onUpdate};
};

Expand Down

0 comments on commit a6fac44

Please sign in to comment.