Spread Attributes

We can spread rest props over our <Text>.

function ArticleTitle({title, ...rest}) {
return <Text {...rest}>{title} for React Native</Text>;

This allow us to modify the parent component.
We can pass attributes to <ArticleTitle /> and trust that they'll be passed through to div.

<ArticleTitle title="Learn JavaScript" style={{ color: 'yellow' }} />


Be the first to receive insightful articles and actionable resources that help you to elevate your skills.