entria / react-native-fontawesome

React Native Font Awesome Icons
MIT License
176 stars 34 forks source link

Add Typescript types #30

Closed kristerkari closed 6 years ago

kristerkari commented 6 years ago

This PR adds Typescript types for Icons and Icon.

I used React.ComponentClass<any> , so that any props can be added to the font awesome component. Looking at the code it looks like the props are passed through to <Text />, so this type declaration does not limit that feature.

Closes #27

kristerkari commented 6 years ago

I tested the types in my Typescript project, and it seems to be working as expected now. :)

sibelius commented 6 years ago

should we type children as well?

kristerkari commented 6 years ago

should we type children as well?

I don't know if there is any need to do that. It should work normally with the current settings.

Would be nice to include proper typing for the available icons, so let's see if I manage to resolve this: https://github.com/entria/react-native-fontawesome/pull/30#discussion_r172168578