-
export interface TestProps {
Icon: (props: { className: string }) => JSX.Element;
children?: string;
}
export default function Test({ Icon, children }: TestProps) {
return (
<div>
<Icon css={{ width: "2rem" }} />
{children}
</div>
);
} Gives me the following error (on
Anybody knows what's the correct way to type this? |
Beta Was this translation helpful? Give feedback.
Answered by
srmagura
Mar 17, 2022
Replies: 2 comments 4 replies
-
Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given. |
Beta Was this translation helpful? Give feedback.
2 replies
-
You just need to set |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
tavoyne
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You just need to set
className
to optional in the definition of theIcon
prop. SoclassName?: string
.