1. 5
    Style Components in a React Native App with StyleSheet
    3m 11s

Style Components in a React Native App with StyleSheet

InstructorChris Achard

Share this video with your friends

Send Tweet

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.

Niklas
~ 5 years ago

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... })