diff --git a/src/index.tsx b/src/index.tsx index e0bfa4a..e7da592 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -110,6 +110,7 @@ type ImperativeApiOptions = { }; export type InfinitePagerImperativeApi = { + getPage: () => number; setPage: (index: number, options: ImperativeApiOptions) => void; incrementPage: (options: ImperativeApiOptions) => void; decrementPage: (options: ImperativeApiOptions) => void; @@ -230,6 +231,7 @@ function InfinitePager( useImperativeHandle( ref, () => ({ + getPage: () => curIndexRef.current, setPage, incrementPage: (options?: ImperativeApiOptions) => { setPage(curIndexRef.current + 1, options);