perf: avoid layout re-rendering
This commit is contained in:
15
components/custom/customLink.tsx
Normal file
15
components/custom/customLink.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import Link from 'next/link';
|
||||
import { Button } from '../ui/button';
|
||||
|
||||
type LinkProps = {
|
||||
path: string;
|
||||
text: string;
|
||||
};
|
||||
|
||||
export function CustomLink({ path, text }: LinkProps) {
|
||||
return (
|
||||
<Button asChild>
|
||||
<Link href={path}>{text}</Link>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user