diff --git a/docs/next/style.html b/docs/next/style.html index 30adda1a6af..35d5a161db3 100644 --- a/docs/next/style.html +++ b/docs/next/style.html @@ -39,6 +39,17 @@
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
+const styles = StyleSheet.create({
+ bigblue: {
+ color: 'blue',
+ fontWeight: 'bold',
+ fontSize: 30,
+ },
+ red: {
+ color: 'red',
+ },
+});
+
export default class LotsOfStyles extends Component {
render() {
return (
@@ -52,20 +63,9 @@
}
}
-const styles = StyleSheet.create({
- bigblue: {
- color: 'blue',
- fontWeight: 'bold',
- fontSize: 30,
- },
- red: {
- color: 'red',
- },
-});
-
// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject', () => LotsOfStyles);
-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 text style. Check out the Text component reference for a complete list.
diff --git a/docs/next/style/index.html b/docs/next/style/index.html index 30adda1a6af..35d5a161db3 100644 --- a/docs/next/style/index.html +++ b/docs/next/style/index.html @@ -39,6 +39,17 @@import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
+const styles = StyleSheet.create({
+ bigblue: {
+ color: 'blue',
+ fontWeight: 'bold',
+ fontSize: 30,
+ },
+ red: {
+ color: 'red',
+ },
+});
+
export default class LotsOfStyles extends Component {
render() {
return (
@@ -52,20 +63,9 @@
}
}
-const styles = StyleSheet.create({
- bigblue: {
- color: 'blue',
- fontWeight: 'bold',
- fontSize: 30,
- },
- red: {
- color: 'red',
- },
-});
-
// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject', () => LotsOfStyles);
-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 text style. Check out the Text component reference for a complete list.