Dimensions
info
useWindowDimensions is the preferred API for React components. Unlike Dimensions, it updates as the window's dimensions update. This works nicely with the React paradigm.
React TSX
import {Dimensions} from 'react-native';
You can get the application window's width and height using the following code:
React TSX
const windowWidth = Dimensions.get('window').width;