Parameter 'props' implicitly has an 'any' type

I'm a typescript noob. How do i specify that props should have hrefs and children. should i use typeof Link or something here?
No description
4 Replies
Matvey
Matvey2y ago
ComponentProps<typeof Link> to get all possible props. or just
type MyLinkProps = {
href: String;
children: ReactNode;
}
type MyLinkProps = {
href: String;
children: ReactNode;
}
Ryan
RyanOP2y ago
No description
Ryan
RyanOP2y ago
'href' is specified more than once, so this usage will be overwritten.ts(2783) Is that how you would specify the type?
Matvey
Matvey2y ago
yes

Did you find this page helpful?