diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-04-11 11:06:38 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-04-11 11:06:38 +0700 |
| commit | 3df233e0c23e7d4503931ab6ec8ffc41642ac104 (patch) | |
| tree | ccc032defe422f5fafc4a08af672833b2fe41835 /src/core/components/elements/Link | |
| parent | 006c77a85786c24199db157d1d70f48b47311d35 (diff) | |
| parent | f0a720441def88187b3913268238c379362fb9d3 (diff) | |
Merge branch 'master' into development_tri/feedback_UAT
Diffstat (limited to 'src/core/components/elements/Link')
| -rw-r--r-- | src/core/components/elements/Link/Link.jsx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/components/elements/Link/Link.jsx b/src/core/components/elements/Link/Link.jsx index 360444a6..f6b39d45 100644 --- a/src/core/components/elements/Link/Link.jsx +++ b/src/core/components/elements/Link/Link.jsx @@ -1,14 +1,14 @@ import NextLink from 'next/link' -import { useRouter } from 'next/router' -import { useEffect } from 'react' +/** + * The `Link` component is used to render Next.js links with customizable properties such as `children`, `scroll`, and `className`. + * + * @param {Object} props - Props passed to the `Link` component. + * @param {ReactNode} props.children - Child elements to be rendered as link content. + * @param {string} props.className - Additional CSS class to be applied to the link. + * @returns {JSX.Element} - Rendered `Link` component. + */ const Link = ({ children, ...props }) => { - const router = useRouter() - - useEffect(() => { - router.events.on('routeChangeComplete', () => window.scrollTo({ top: 0, behavior: 'smooth' })) - }, [router]) - return ( <NextLink {...props} |
