I am trying to do as following in react-native. I am setting a borderRadius in the parent view. But the child is overriding that. So in the final view, the borderRadius is not visible
export default class FlexDimensionsBasics extends Component {
render() {
return (
// Try removing the `flex: 1` on the parent View.
// The parent will not have dimensions, so the children can't expand.
// What if you add `height: 300` instead of `flex: 1`?
<View style={{flex: 1, borderRadius:30, backgroundColor:'red'}}>
<View style={{flexGrow: 10, backgroundColor: 'powderblue'}} />
<View style={{flexGrow: 20, backgroundColor: 'skyblue'}} />
<View style={{flexGrow: 30, backgroundColor: 'steelblue'}} />
</View>
);
}
}
is there anything which I am missing to add?
To pass data from child to parent component in React:Pass a function as a prop to the Child component. Call the function in the Child component and pass the data as arguments. Access the data in the function in the Parent .
According to the article, you can use react-native-view'overflow library (a bridging header written to support the overflow in react-native android. All you need to do is wrap the overflowcomponent in the <ViewOverflow> . Hope this helps!
The react-script-tag is a package that comes up with a <script> tag that supports universal rendering. With the help of this library, we can directly append the <script> tag to our document. And inside the 'src' attribute of the script tag, we can include the URL of the external JavaScript library.
Add overflow: "hidden"
to your parent style
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With