react-native-svg-transformer icon indicating copy to clipboard operation
react-native-svg-transformer copied to clipboard

README doc casting type React.FC<SvgProps> on {...props}

Open Luk-kar opened this issue 3 years ago • 0 comments

Where?

https://github.com/kristerkari/react-native-svg-transformer#using-typescript

What to add?

If you want to spread unknown props into the component you have cast type React.FC<SvgProps> on it.

<Logo width={120} height={40} {...props as React.FC<SvgProps>}/>

Why?

It took me a while to get why I had an error. Yeah, I know that it looks obvious at first, but I will know it earlier it would save me time.


Thanks for your plugin anyway, keep it up with great work!

Luk-kar avatar Apr 19 '21 13:04 Luk-kar