Skip to content

Commit 331fb61

Browse files
committed
update the way of using module Dimensions
1 parent de67720 commit 331fb61

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/Animations.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ make them customizable, React Native exposes a
529529
[NavigatorSceneConfigs](https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js) API.
530530
531531
```javascript
532-
var SCREEN_WIDTH = require('Dimensions').get('window').width;
532+
var React = require('react-native');
533+
var { Dimensions } = React;
534+
var SCREEN_WIDTH = Dimensions.get('window').width;
533535
var BaseConfig = Navigator.SceneConfigs.FloatFromRight;
534536

535537
var CustomLeftToRightGesture = Object.assign({}, BaseConfig.gestures.pop, {

0 commit comments

Comments
 (0)