import React, { PropsWithChildren, ReactElement } from 'react'
import { Link as HyperLink, LinkProps } from 'react-router-dom'

export default function Link({
  to,
  children,
  ...rest
}: PropsWithChildren<LinkProps>): ReactElement {
  return (
    <HyperLink to={to} {...rest} replace>
      {children}
    </HyperLink>
  )
}

import React, { PropsWithChildren, ReactElement } from 'react'
import { Link as HyperLink, LinkProps } from 'react-router-dom'

export default function Link({
  to,
  children,
  ...rest
}: PropsWithChildren<LinkProps>): ReactElement {
  return (
    <HyperLink to={to} {...rest}>
      {children}
    </HyperLink>
  )
}

--- 
+++ 
@@ -7,7 +7,7 @@
   ...rest
 }: PropsWithChildren<LinkProps>): ReactElement {
   return (
-    <HyperLink to={to} {...rest}>
+    <HyperLink to={to} {...rest} replace>
       {children}
     </HyperLink>
   )
Fix 'cannot PUSH the same path' warning from Router on Link component by the replace prop
