React Native Dimensions Hooks
Hooks to wrap the React Native Dimensions API for Native and React Native Web.
They use listeners under the hood, so they will update on window and screen size changes.
Usage:
import React from 'react';import useDimensions from 'react-native-dimensions-hooks'; const window screen = ; return <div> <div>Window JSON</div> <div>Screen JSON</div> </div> ;;
Window or screen may be also imported individually by useWindowDimensions
or useScreenDimension
.
import useWindowDimensions useScreenDimension from 'react-native-dimensions-hooks'; ... const useScreenDimension = ;const windowDimensions = ;