Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Example/imageViewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ class Viewer extends Component {
);
}
render() {
const pinchRef = React.createRef();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be created inside render method

const panRef = React.createRef();
// The below two animated values makes it so that scale appears to be done
// from the top left corner of the image view instead of its center. This
// is required for the "scale focal point" math to work correctly
Expand All @@ -380,15 +382,15 @@ class Viewer extends Component {
return (
<View style={styles.wrapper}>
<PinchGestureHandler
id="pinch"
simultaneousHandlers="pan"
ref={pinchRef}
simultaneousHandlers={panRef}
onGestureEvent={this._onPinchEvent}
onHandlerStateChange={this._onPinchEvent}>
<Animated.View>
<PanGestureHandler
id="pan"
ref={panRef}
avgTouches
simultaneousHandlers="pinch"
simultaneousHandlers={pinchRef}
onGestureEvent={this._onPanEvent}
onHandlerStateChange={this._onPanEvent}>
<Animated.Image
Expand Down
2 changes: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"react": "16.3.2",
"react-native": "0.55.3",
"react-native-gesture-handler": "^1.0.0-alpha.43",
"react-native-gesture-handler": "^1.0.0",
"react-native-reanimated": "file:../",
"react-navigation": "^1.5.11"
},
Expand Down
8 changes: 4 additions & 4 deletions Example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4180,16 +4180,16 @@ [email protected]:
dependencies:
react-native-dismiss-keyboard "1.0.0"

react-native-gesture-handler@^1.0.0-alpha.43:
version "1.0.0-alpha.43"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.0.0-alpha.43.tgz#4a5c324b6a70cf44d31934a631ce6029c8a460e2"
react-native-gesture-handler@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.0.0.tgz#442c9da5190a9fceb982489f235e889214312e95"
dependencies:
hoist-non-react-statics "^2.3.1"
invariant "^2.2.2"
prop-types "^15.5.10"

"react-native-reanimated@file:..":
version "1.0.0-alpha.1"
version "1.0.0-alpha.2"

react-native-safe-area-view@^0.7.0:
version "0.7.0"
Expand Down