react-native-viewport-units
react-native-viewport-units copied to clipboard
Fixes Invalid directory Users/Node_modules/Dimensions
This fixes the issue found here https://github.com/jmstout/react-native-viewport-units/issues/4#issuecomment-157808000
+1
+1, I kind of need this also
+1 lets get this merged and on npm
+1
Need this as well 👍
@jotem If i where you I would just fork it or make your own util file with this functionality and add it to your project. This project has not been touched for a long time.
Already did that, thanks anyway ;)
This library still works fine - just need to merge in this PR
v 0.05 with RN 53 - have a crash
I maked fork for maintain this project https://github.com/enieber/react-native-viewport-units
It is also possible to create a single .js file with the following:
import { Dimensions } from 'react-native';
export const width = Dimensions.get('window').width;
export const height = Dimensions.get('window').height;
// vw/vh are 1% of the screen width/height respectively
export const vw = width / 100;
export const vh = height / 100;
export const vmin = Math.min(vw, vh);
export const vmax = Math.max(vw, vh);
+1 fix works for me