import React , { forwardRef , Ref } from 'react' ; import { Link as RouterLink , LinkProps as RouterLinkProps } from 'react-router-dom' ; import { Button , ButtonProps } from '@chakra-ui/core/dist' ; type Props = ButtonProps & RouterLinkProps ; see https export const ButtonLink = forwardRef < Ref < any > , Props > ( ( { children , ... rest } , ref ) => { return ( < Button ref = { ref } as = { RouterLink } { ... rest } > { children } < /Button>); } ) ;