2.3.9 Nested Views Codehs | !free!

Remember that styling properties are not automatically inherited by child views. If you want a nested view to center its internal items, you must explicitly add justifyContent: 'center' and alignItems: 'center' directly to that nested view's style object.

// Child 4: Follow Button Text var buttonText = new Text("Follow"); buttonText.setPosition(100, 170); buttonText.setColor("white"); buttonText.setTextAlign("center"); 2.3.9 nested views codehs

A simple example from the CodeHS documentation demonstrates a Text component nested inside a parent View , alongside another nested View : 2.3.9 nested views codehs

export default class App extends Component render() return ( <View style=styles.container> <View style=styles.red> <Text>Red Band</Text> </View> <View style=styles.green> <Text>Green Band</Text> </View> <View style=styles.blue> <Text>Blue Band</Text> </View> </View> ); 2.3.9 nested views codehs