youngtailors / react-silk

Seamless components that work on both react web and native
https://youngtailors.github.io/react-silk
MIT License
17 stars 4 forks source link

Add global variable to help these components detect native app or web #13

Open hieuhani opened 5 years ago

hieuhani commented 5 years ago

Should we use (typeof window) ? 'web' : 'native'?

lednhatkhanh commented 5 years ago

We can try this API.

hieuhani commented 5 years ago

https://github.com/necolas/react-native-web/blob/8ce5750d3437d1caa3d74a74a3625c70c54b66ab/packages/react-native-web/src/exports/Platform/index.js#L12

They just set the OS to 'web'. Our main purpose is creating a UI kit that works on both web and native app without configuration