Skip to content

Latest commit

 

History

History
4 lines (4 loc) · 913 Bytes

File metadata and controls

4 lines (4 loc) · 913 Bytes

18 Building Responsive Layouts with Flexbox

  • 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, if StatusBar.currentHeight was available on iOS and Android, you wouldn’t need to call Platform.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 than justify-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.