react-native-swiper: Unable to resolve module Dimensions from

Hello,

I get the following warning in the packager:

Unable to resolve module Dimensions from .... dist.js

Any idea how to fix that? Everything is working correctly, just the message in the packager.

Regards

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Hi,

you can fix it by changing the following in dist/index.js:

from:

var _Dimensions = require('Dimensions');

var _Dimensions2 = _interopRequireDefault(_Dimensions);

var _Dimensions$get = _Dimensions2['default'].get('window');

to

var React = require('react-native');
var {
  Dimensions
} = React;
var {width, height} = Dimensions.get('window');

Regards Philipp