Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow props forwarded to the svg component in typescript #48

Closed
zozoens31 opened this issue Mar 15, 2019 · 2 comments · Fixed by #50
Closed

Allow props forwarded to the svg component in typescript #48

zozoens31 opened this issue Mar 15, 2019 · 2 comments · Fixed by #50
Labels

Comments

@zozoens31
Copy link

Since we can forward props to the svg element (eg style), this should be reflected in the props type definition MdiReactIconProps.

To reproduce:

import CloseIcon from 'mdi-react/CloseIcon'

const MyComponent: React.FC<{}> = () => {
  return <CloseIcon style={{marginLeft: 5}} />
}

This raises a type-script error

error TS2322: Type '{ style: { marginLeft: number; }; }' is not assignable to type 'IntrinsicAttributes & MdiReactIconProps & { children?: ReactNode; }'.
  Property 'style' does not exist on type 'IntrinsicAttributes & MdiReactIconProps & { children?: ReactNode; }'.
@levrik
Copy link
Owner

levrik commented Apr 16, 2019

You're right. I will take a look at #50 by @pcorpet soon.

pcorpet added a commit to bayesimpact/mdi-react that referenced this issue Sep 11, 2019
pcorpet added a commit to bayesimpact/mdi-react that referenced this issue Sep 21, 2019
pcorpet added a commit to bayesimpact/mdi-react that referenced this issue Sep 21, 2019
@levrik
Copy link
Owner

levrik commented Nov 30, 2019

Released in 6.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants