mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-02 12:25:44 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
17 lines
511 B
TypeScript
17 lines
511 B
TypeScript
import React from 'react';
|
|
import { Link } from '@tanstack/react-router';
|
|
|
|
interface Props extends Omit<React.ComponentProps<'a'>, 'href'> {
|
|
to: string;
|
|
params?: Record<string, string>;
|
|
exact?: boolean;
|
|
hash?: string;
|
|
}
|
|
|
|
/** Untyped <Link> for menus whose `to` is built at runtime. */
|
|
const NavLink = ({ to, params, exact = false, ...rest }: Props) => (
|
|
<Link to={to as never} params={params as never} activeOptions={{ exact, includeSearch: false }} {...rest} />
|
|
);
|
|
|
|
export default NavLink;
|