Para resumir, estoy escribiendo una aplicación de calculadora en react-native y quiero tener 2 vistas diferentes para cuando el teléfono está vertical y horizontalmente, ¿hay una manera rápida de orientar el teléfono sin instalar ningún paquete?
import { Dimensions } from 'react-native'; function useIsHorizonal() { const [isHorizonal, setIsHorizonal] = useState( Dimensions.screen.width > Dimensions.screen.height ) useEffect(()=> { Dimensions.addEventListener( 'change', ({ screen: { width, height }}) => setIsHorizonal(width > height) ) }, []) return isHorizonal }