diff --git a/docs/Text.md b/docs/Text.md index 86537f8a2..dfed9b145 100644 --- a/docs/Text.md +++ b/docs/Text.md @@ -121,6 +121,22 @@ You also lose the ability to set up a default font for an entire subtree. The re ``` +Assuming that `MyAppText` is a component that simply renders out its children into a `Text` component with styling, then `MyAppHeaderText` can be defined as follows: + +```javascript +class MyAppHeaderText extends Component { + render() { + + + {this.props.children} + + + } +} +``` + +Composing `MyAppText` in this way ensures that we get the styles from a top-level component, but leaves us the ability to add / override them in specific use cases. + React Native still has the concept of style inheritance, but limited to text subtrees. In this case, the second part will be both bold and red. ```javascript