Replies: 2 comments 2 replies
-
👀 |
Beta Was this translation helpful? Give feedback.
0 replies
-
import Link from 'next/link';
import { CommandItem } from '@/components/ui/command';
export function CommandMenu() {
return (
<CommandItem asChild>
<Link href="/dashboard">Dashboard</Link>
</CommandItem>
);
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I just checked the source code for the documentation page, i.e. for the command-menu. It looks like this
So for navigating we are using
router.push
instead of usingLink
fromnext/link
. Isn't that suboptimal? I assume you'd prefer to have prefetching which comes for free withLink
but is that even possible withCommandItem
? Alternatively you can dorouter.prefetch
I guess. See here for more details. I realise it isn't a big deal for this site (probably) but in other cases it might be.Beta Was this translation helpful? Give feedback.
All reactions