@upbeat shoal saw somone asked you this here as well #router message
I tried this implementation below. Not sure if this is the best way of doing this but not sure how to get type safety of the routes and apply active/inactive styling with the button wrapping the Link
any suggestions?
import { Link } from '@tanstack/react-router'
import { Button } from '../ui'
export type NavElementProps = {
name: string
icon: React.ReactNode
route: string
}
export const NavElement: React.FC<NavElementProps> = ({
name,
route,
icon,
}) => {
return (
<Button variant={'outline'}>
{icon}
<Link
params={{}}
search={{}}
to={route}
activeProps={{}}
inactiveProps={{}}
>
{name}
</Link>
</Button>
)
}