At our company we have several React Native components built for iOS. They are all JavaScript based components, so they should work under React Native for Android also. Also, most of the components we have should only differ in the design style, so we need to code those differences between both platforms.
What's the right way to enable this components to support Android? Do we have to use if
's checking the app Platform
and change the style accordingly? If we want to separate the components in two files, Component.android.js
and Component.ios.js
, is React Native going to automatically detect which one it needs to use depending on the platform it's running?