react-native-viewport-units
Version:
Incredibly simple utility for (sort of) using viewport units with React Native.
15 lines (11 loc) • 320 B
JavaScript
;
var React = require('react-native')
, Dimensions = React.Dimensions || require('Dimensions')
, {width, height} = Dimensions.get('window');
var units = {
vw: width/100
, vh: height/100
};
units.vmin = Math.min(units.vw, units.vh);
units.vmax = Math.max(units.vw, units.vh);
module.exports = units;