mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
feat(website): enhance lazy loading
This commit is contained in:
@@ -31,10 +31,10 @@ export interface ItemLinkProps
|
||||
* generate the full path to the item client-side.
|
||||
*/
|
||||
export function ItemLink(props: PropsWithChildren<ItemLinkProps>) {
|
||||
const path = usePathname();
|
||||
const pathname = usePathname();
|
||||
const { packageName, version } = useCurrentPathMeta();
|
||||
|
||||
if (!path) {
|
||||
if (!pathname) {
|
||||
throw new Error('ItemLink must be used inside a Next.js page. (e.g. /docs/packages/foo/main)');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user