Created
June 8, 2016 20:04
-
-
Save adamterlson/04a8fe8fcd2d7fb0a09d252ed76c33bc to your computer and use it in GitHub Desktop.
Overriding default child styles in RN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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