Merge pull request #4752 from sunnylqm/patch-12

update the way of using module Dimensions
This commit is contained in:
James Ide 2015-12-13 01:35:35 -08:00
commit a70be679f6
1 changed files with 3 additions and 1 deletions

View File

@ -529,7 +529,9 @@ make them customizable, React Native exposes a
[NavigatorSceneConfigs](https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js) API.
```javascript
var SCREEN_WIDTH = require('Dimensions').get('window').width;
var React = require('react-native');
var { Dimensions } = React;
var SCREEN_WIDTH = Dimensions.get('window').width;
var BaseConfig = Navigator.SceneConfigs.FloatFromRight;
var CustomLeftToRightGesture = Object.assign({}, BaseConfig.gestures.pop, {