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
Matvey16mo ago
ComponentProps<typeof Link> to get all possible props. or just
type MyLinkProps = {
href: String;
children: ReactNode;
}
type MyLinkProps = {
href: String;
children: ReactNode;
}
Ryan
RyanOP16mo ago
No description
Ryan
RyanOP16mo ago
'href' is specified more than once, so this usage will be overwritten.ts(2783) Is that how you would specify the type?
Matvey
Matvey16mo ago
yes

Did you find this page helpful?