File tree 1 file changed +2
-4
lines changed 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,9 @@ import { useActor } from "@xstate/react"
7
7
import { ChooseOne , Cond } from "components/Conditionals/ChooseOne"
8
8
import { Maybe } from "components/Conditionals/Maybe"
9
9
import { CSSProperties } from "react"
10
- import { useSearchParams } from "react-router-dom"
11
10
import { PaginationMachineRef } from "xServices/pagination/paginationXService"
12
11
import { PageButton } from "./PageButton"
13
- import { buildPagedList , getInitialPage } from "./utils"
12
+ import { buildPagedList } from "./utils"
14
13
15
14
export type PaginationWidgetProps = {
16
15
prevLabel ?: string
@@ -32,8 +31,7 @@ export const PaginationWidget = ({
32
31
const styles = useStyles ( )
33
32
const [ paginationState , send ] = useActor ( paginationRef )
34
33
35
- const [ searchParams , _ ] = useSearchParams ( )
36
- const currentPage = getInitialPage ( searchParams . get ( "page" ) )
34
+ const currentPage = paginationState . context . page
37
35
const numRecordsPerPage = paginationState . context . limit
38
36
39
37
const numPages = numRecords ? Math . ceil ( numRecords / numRecordsPerPage ) : 0
You can’t perform that action at this time.
0 commit comments