feat(SW-1446): add Jump to functionality to Destination Overview Page
This commit is contained in:
22
apps/scandic-web/components/RACRouterProvider/index.tsx
Normal file
22
apps/scandic-web/components/RACRouterProvider/index.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
// https://react-spectrum.adobe.com/react-aria/routing.html#app-router
|
||||
|
||||
"use client"
|
||||
|
||||
import { useRouter } from "next/navigation"
|
||||
import { RouterProvider } from "react-aria-components"
|
||||
|
||||
import type { PropsWithChildren } from "react"
|
||||
|
||||
declare module "react-aria-components" {
|
||||
interface RouterConfig {
|
||||
routerOptions: NonNullable<
|
||||
Parameters<ReturnType<typeof useRouter>["push"]>[1]
|
||||
>
|
||||
}
|
||||
}
|
||||
|
||||
export function RACRouterProvider({ children }: PropsWithChildren) {
|
||||
const router = useRouter()
|
||||
|
||||
return <RouterProvider navigate={router.push}>{children}</RouterProvider>
|
||||
}
|
||||
Reference in New Issue
Block a user