What does the null width value mean in a native reaction?

I discussed several questions about SO and several applications, where I came across the following style configuration: -

container: { flex:1, width: null, }, 

I was wondering what width:null is used here. Can anybody help?

+7
react-native
source share
1 answer
 <Image source={require('./images/MacWallPaper.jpg')} style={styles.container}> </Image> 

When you do not specify width: null and height: null , the component retrieves the actual width and height of the original image.

 container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(0, 0, 0, 0)', } 

when you explicitly specify width: null and height: null , the component will not use the actual width and height of the image.

 container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(0, 0, 0, 0)', // remove width and height to override fixed static size width: null, height: null, } 

Watch this video

+6
source share

All Articles