Skip to content

Commit

Permalink
fix: router instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Jul 22, 2023
1 parent 6da8325 commit b3d834c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/ui/markdown/renderers/link.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { memo, useCallback } from 'react'
import Router from 'next/router'
import { useRouter } from 'next/navigation'
import type { FC, ReactNode } from 'react'

import {
Expand All @@ -17,6 +17,7 @@ export const MLink: FC<{
title?: string
children?: ReactNode
}> = memo(({ href, children, title }) => {
const router = useRouter()
const handleRedirect = useCallback(
(e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
const locateUrl = new URL(location.href)
Expand All @@ -36,7 +37,7 @@ export const MLink: FC<{
case 'posts':
case 'notes':
case 'category': {
Router.push(toUrlParser.pathname)
router.push(toUrlParser.pathname)
break
}
default: {
Expand Down

1 comment on commit b3d834c

@vercel
Copy link

@vercel vercel bot commented on b3d834c Jul 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-git-main-innei.vercel.app
springtide.vercel.app
shiro-innei.vercel.app
innei.in

Please sign in to comment.