Utilizing the Link
component from @material-ui/core/Link
in my TypeScript code was initially successful:
<Link href="#" variant="body2">
Forgot?
</Link>
However, I am exploring the transition to styled-components
located in a separate file. Presently, I'm attempting to incorporate this approach (for example: https://styled-components.com/docs/basics):
const Link = ({ className, children}) => (
<a className={className}>
{children}
</a>
);
export const StyledLink = styled(Link)`
href: #;
variant: body2;
`;
coupled with:
<StyledLink>Forgot?</StyledLink>
Nevertheless, I'm encountering errors related to className
and children
, specifically
Binding element 'children' implicitly has an 'any' type.ts(7031)
. Even after specifying any
, it remains unresolved.
What is the appropriate methodology for integrating styled-components in this scenario? Alternatively, are there any other alternatives for css-in-js
implementation?