There is no such thing as "maxWidth" in React Native. You may want to create your component at runtime. Try playing with Dimensions. You can get the screen width and screen height of the device and adjust the width of your component accordingly.
You can define two different style objects.
For a full-width component on a device with a width of less than 600.
componentStyle_1: {
flex: 1
}
Width 600 for devices with a width greater than 600
componentStyle_2: {
width: 600
}
You can check the runtime of the device.
var {height, width} = Dimensions.get('window');
if(width>600){
}
else{
}
The best way to get accurate results is to play with your code. Good luck
Contact: https://facebook.imtqy.com/react-native/docs/dimensions.html#content
source
share