I have a styled button:
import { Link } from 'react-router-dom'
import styled from 'styled-components'
const Button = styled(Link)`
display: block;
border: 1px solid white;
padding: 5px;
`
I can use it as a Link:
<Button to='/' />
But sometimes I would like to use it as an a:
<Button as='a' href='/' />
But in a second case TypeScript is complaining with:
Type '{ children: string; as: string; href: string; }' is not assignable to type 'Readonly<ThemedOuterStyledProps<WithOptionalTheme<LinkProps, any>, any>>'.
Property 'to' is missing in type '{ children: string; as: string; href: string; }'.