I'm new to react and I'm trying to understand how the general syntax works, not sure if this is an appropriate place to ask this. The following is my code for a simple title component.
export default class Title extends Component {
render () {
const {children} = this.props;
return (
<View style={styles.header}>
<Text style={styles.title}>{children}</Text>
</View>
)
}
}
is this
const {children} = this.props;
is equivalent to
const children = this.props.children;
If so, which is the correct form to use? Just trying to get a better understanding how react works, in addition, would the following try to get the children of the children of the props?
const {children} = this.props.children