Skip to content

Instantly share code, notes, and snippets.

@adamterlson
Created June 8, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamterlson/04a8fe8fcd2d7fb0a09d252ed76c33bc to your computer and use it in GitHub Desktop.
Save adamterlson/04a8fe8fcd2d7fb0a09d252ed76c33bc to your computer and use it in GitHub Desktop.
Overriding default child styles in RN
class MyChildComponent extends Component {
render() {
return (
<View style={[{ height: 100 }, this.props.style]}>
The height of this container will be **50**
</View>
);
}
}
class MyParentComponent extends Component {
render() {
return (
<MyChildComponent style={{ height: 50 }} />
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment