style. The style names and values usually match how CSS works on the web, except names are written using camel casing, e.g.
backgroundColor rather than
As a component grows in complexity, it is often cleaner to use
StyleSheet.create to define several styles in one place. Here's an example:
One common pattern is to make your component accept a
style prop which in turn is used to style subcomponents. You can use this to make styles "cascade" the way they do in CSS.
There are a lot more ways to customize the text style. Check out the Text component reference for a complete list.
Now you can make your text beautiful. The next step in becoming a style expert is to learn how to control component size.
- react-native#29308: In some cases React Native does not match how CSS works on the web, for example the touch area never extends past the parent view bounds and on Android negative margin is not supported.