we have to get the dimension first using the get api which is for example let windowWidth = Dimensions.get('window').width so after this we can use this variable(windoWidth) to use ternary condition or if as you wish and also we have to import dimension form expo-route too