We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6da8325 commit b3d834cCopy full SHA for b3d834c
src/components/ui/markdown/renderers/link.tsx
@@ -1,5 +1,5 @@
1
import { memo, useCallback } from 'react'
2
-import Router from 'next/router'
+import { useRouter } from 'next/navigation'
3
import type { FC, ReactNode } from 'react'
4
5
import {
@@ -17,6 +17,7 @@ export const MLink: FC<{
17
title?: string
18
children?: ReactNode
19
}> = memo(({ href, children, title }) => {
20
+ const router = useRouter()
21
const handleRedirect = useCallback(
22
(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
23
const locateUrl = new URL(location.href)
@@ -36,7 +37,7 @@ export const MLink: FC<{
36
37
case 'posts':
38
case 'notes':
39
case 'category': {
- Router.push(toUrlParser.pathname)
40
+ router.push(toUrlParser.pathname)
41
break
42
}
43
default: {
0 commit comments