Skip to content

Commit

Permalink
fix: pagination callback not rerendering when switching queries
Browse files Browse the repository at this point in the history
  • Loading branch information
yandex-moonbreeze committed Dec 5, 2023
1 parent 644f7e1 commit 5d00482
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ export function ResultPaginator({queryId, resultIndex, className}: Props) {
[dispatch],
);

const goToPage = useCallback((page: number) => {
dispatch(updateQueryResult(queryId, resultIndex, page));
}, []);
const goToPage = useCallback(
(page: number) => {
dispatch(updateQueryResult(queryId, resultIndex, page));
},
[queryId],
);

return (
<div className={b(null, className)}>
Expand Down

0 comments on commit 5d00482

Please sign in to comment.