Given the following code, I'm wondering who is rendering the actual message. Since the flow is supposed to go from parent component, here ScreenOne, to child component, Heading, is it then that parent component sends down the message to Heading who returns the html element to the parent, and parent then renders it the actual message as the final stop? So in essence, it's going from parent to child, and back to parent?
// Parent
export default class ScreenOne extends React.Component {
render () {
return (
<View>
<Heading message={'Custom Heading for Screen One'}/>
</View>
)
}
}
// Child component
export default class Heading extends React.Component {
render () {
return (
<View>
<Text>{this.props.message}</Text>
</View>
)
}
}
Heading.propTypes = {
message: PropTypes.string
}
Heading.defaultProps = {
message: 'Heading One'
}