react-native-full-responsive
Version:
Create a fully responsive React Native app for all supported platforms
17 lines • 534 B
JavaScript
import { useMemo } from 'react';
import { rs } from '../layout';
import { useDevice } from './useDevice';
import { useWindowDimensions } from 'react-native';
const useResponsiveScale = size => {
const device = useDevice();
const {
width,
height
} = useWindowDimensions();
const scaledSize = useMemo(() => {
return rs(size, width, height, device);
}, [size, height, width, device]);
return scaledSize;
};
export { useResponsiveScale, useResponsiveScale as useRS };
//# sourceMappingURL=useResponsiveScale.js.map