- The preceding
Platform.select()
code is an example of a case where you need to implement a workaround for differences in the platform. For example, ifStatusBar.currentHeight
was available on iOS and Android, you wouldn’t need to callPlatform.select()
. - If you want to declare React Native styles, you need to use plain objects. Then, you call
StyleSheet.create()
and export this from the style module. Note that style names are pretty similar to the web CSS, except that they are written in camel case; for example,justifyContent
rather thanjustify-content
. - Styled Components is a CSS-in-JS library that styles React Native components using plain CSS. With this approach, you don’t need to define style classes via objects and provide style props. The CSS itself is determined via tagged template literals provided by styled-components.