Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix Typescript definitions to allow for props forwarded to SVG element: style, onClick, etc. #50
Pick + Exclude is the equivalent of Omit before Omit was invented:
Pick<SVGProps, Exclude<keyof SVGProps, ReservedProps>>
is the equivalent (inTypescript 3.5) of
Which is taking the SVGProps interface but removing the fields mentionned in ReservedProps (size, width, height, fill, viewBox). I'm omitting width & height as you should not set them. I'm omitting size because we're changing its type, and finally omitting fill & viewBox because if you set them on the icon externally those properties are overriden by the implementation.
The exact detail is: Pick<A, Exclude<B, C>>