From a6fac442b82ac585397d0b5cf5f59ec5df625deb Mon Sep 17 00:00:00 2001 From: Kirill Kharitonov Date: Mon, 29 Jan 2024 06:43:25 -0500 Subject: [PATCH] fix(Pagination): stories controls (#1281) --- .../Pagination/__stories__/Pagination.stories.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/Pagination/__stories__/Pagination.stories.tsx b/src/components/Pagination/__stories__/Pagination.stories.tsx index 113167dc8f..b891e9826e 100644 --- a/src/components/Pagination/__stories__/Pagination.stories.tsx +++ b/src/components/Pagination/__stories__/Pagination.stories.tsx @@ -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}; };