UNPKG

react-native-full-responsive

Version:

Create a fully responsive React Native app for all supported platforms

14 lines 467 B
import { useMemo } from 'react'; import { rw } from '../layout'; import { useWindowDimensions } from 'react-native'; const useResponsiveWidth = widthPercentage => { const { width: screenWidth } = useWindowDimensions(); const width = useMemo(() => { return rw(widthPercentage, screenWidth); }, [screenWidth, widthPercentage]); return width; }; export { useResponsiveWidth, useResponsiveWidth as useRW }; //# sourceMappingURL=useResponsiveWidth.js.map