Skip to content

Commit c240a23

Browse files
committed
fix search
1 parent fbc4ad3 commit c240a23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/Search.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import Head from 'next/head';
66
import Link from 'next/link';
7-
import Router from 'next/router';
7+
import {useRouter} from 'next/navigation';
88
import {lazy, useEffect} from 'react';
99
import * as React from 'react';
1010
import {createPortal} from 'react-dom';
@@ -111,6 +111,7 @@ export function Search({
111111
},
112112
}: SearchProps) {
113113
useDocSearchKeyboardEvents({isOpen, onOpen, onClose});
114+
const router = useRouter();
114115
return (
115116
<>
116117
<Head>
@@ -127,7 +128,7 @@ export function Search({
127128
onClose={onClose}
128129
navigator={{
129130
navigate({itemUrl}: any) {
130-
Router.push(itemUrl);
131+
router.push(itemUrl);
131132
},
132133
}}
133134
transformItems={(items: any[]) => {

0 commit comments

Comments
 (0)