One way to style React Native components is with a StyleSheet
, which was designed to be similar to css. We’ll go over the differences between React Native styles and web styles, and we’ll create a new StyleSheet, and use it to change the style of components in our app.
Importing the HeaderStyles and using it directly will throw a warning about unknown 'header' key in Styles as it appears the file is trying to read it as some sort of external module. To over come this, maintain a header property in your local StyleSheet and simply use the imported Object as the value, then this warning ignores.
StyleSheet.create({ header: HeaderStyle.header... })