When I try to use:
const {width, height} = Dimensions.get('window');
On a react native component, I get a weird error never seen before:
Can't find variable: Dimensions
Have someone face this issue before?
"dependencies": {
"expo": "^22.0.0",
"react": "16.0.0-beta.5",
"react-native": "https://github.com/expo/react-native/archive/sdk-22.0.2.tar.gz"
},
Fix it... my mistake, I should import from react-native Dimensions.
import {Dimensions} from 'react-native';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With