Open History to see the last commit
1import React from 'react'
2import { createLink } from '@tanstack/react-router'
3import { Button } from '@mui/material'
4import type { ButtonProps } from '@mui/material'
5import type { LinkComponent } from '@tanstack/react-router'
6β
7interface MUIButtonLinkProps extends ButtonProps<'a'> {
8 // Add any additional props you want to pass to the Button
9}
10β
11const MUIButtonLinkComponent = React.forwardRef<
12 HTMLAnchorElement,
13 MUIButtonLinkProps
14>((props, ref) => <Button ref={ref} component="a" {...props} />)
15β
16const CreatedButtonLinkComponent = createLink(MUIButtonLinkComponent)
17β
18export const CustomButtonLink: LinkComponent<typeof MUIButtonLinkComponent> = (
19 props,
20) => {
21 return <CreatedButtonLinkComponent preload={'intent'} {...props} />
22}