Skip to content

Instantly share code, notes, and snippets.

@arnoldc
Last active October 29, 2021 11:15
Show Gist options
  • Select an option

  • Save arnoldc/473f6b74fadcd83fcd0f31765b217d64 to your computer and use it in GitHub Desktop.

Select an option

Save arnoldc/473f6b74fadcd83fcd0f31765b217d64 to your computer and use it in GitHub Desktop.
[React Native] Styling
// ways
<Text style={styles.paragraph} />
<Text style={{ fontSize: 16 }} />
<Text style={[styles.paragraph, { color: 'red' }]} />
// dynamic
// Applies the `selected` style on top of the `paragraph` style if props.isActive is truthy
function Item(props) {
return (
<Text style={[styles.paragraph, props.isActive && styles.selected]} />
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment