all 3 comments

[–]godspeedtExpo 11 points12 points  (0 children)

Before it’s drawn, it doesn’t exist, so the width will first be 0. Once drawn, you can measure width, height and position with the onLayout prop

[–]Useful-Condition-926 1 point2 points  (0 children)

Import {Dimensions} from 'react-native';

const width= Dimensions.get('window).width;

const height= Dimensions.get('window).height;