artsy / palette

Artsy's design system
https://palette-storybook.artsy.net/
MIT License
214 stars 45 forks source link

[Tooling] Fix React Native types #137

Open javamonn opened 5 years ago

javamonn commented 5 years ago

As noted here, palette is currently typed with DOM types regardless of the runtime platform.

Emission currently type-checks, but as a result, TypeScript would erroneously allow a DOM-only prop to be passed without error.

There was some initial exploration work towards fixing this in https://github.com/javamonn/palette/tree/upgrade-typings, though I'm not sure it's the best way forward - it seems like we might need separate stsconfig`s and separate builds.

javamonn commented 5 years ago

An instance in Emission where this caused a type error we had to workaround with a cast: https://github.com/artsy/emission/pull/1223/files#diff-ec3ba1930b2ad578adef27656b4b5cacR18