Skip to content

Commit 0399cf8

Browse files
authored
Wrap bottom sheet in GestureHandlerRootView (#257)
1 parent 2f82935 commit 0399cf8

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"eslint-plugin-react": "^7.12.4",
5656
"husky": "^1.3.1",
5757
"prettier": "^1.17.0",
58-
"react-native-gesture-handler": "^1.1.0",
58+
"react-native-gesture-handler": "^1.6.1",
5959
"react-native-reanimated": "^1.0.1",
6060
"release-it": "^12.4.3",
6161
"typescript": "^3.4.5"

src/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Animated from 'react-native-reanimated'
44
import {
55
PanGestureHandler,
66
TapGestureHandler,
7+
GestureHandlerRootView,
78
State as GestureState,
89
} from 'react-native-gesture-handler'
910

@@ -291,6 +292,8 @@ function withDecaying(
291292
])
292293
}
293294

295+
const GestureHandlerWrapper = GestureHandlerRootView || View;
296+
294297
export default class BottomSheetBehavior extends React.Component<Props, State> {
295298
static defaultProps = {
296299
overdragResistanceFactor: 0,
@@ -793,7 +796,7 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
793796
render() {
794797
const { borderRadius } = this.props
795798
return (
796-
<React.Fragment>
799+
<GestureHandlerWrapper>
797800
<Animated.View
798801
style={{
799802
height: '100%',
@@ -1057,7 +1060,7 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
10571060
)}
10581061
</View>
10591062
</Animated.View>
1060-
</React.Fragment>
1063+
</GestureHandlerWrapper>
10611064
)
10621065
}
10631066
}

yarn.lock

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,13 @@
10591059
dependencies:
10601060
find-up "^2.1.0"
10611061

1062+
"@egjs/hammerjs@^2.0.17":
1063+
version "2.0.17"
1064+
resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124"
1065+
integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==
1066+
dependencies:
1067+
"@types/hammerjs" "^2.0.36"
1068+
10621069
10631070
version "2.2.3"
10641071
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.3.tgz#f060bf6eaafae4d56a7dac618980838b0696e2ab"
@@ -1210,6 +1217,11 @@
12101217
"@types/minimatch" "*"
12111218
"@types/node" "*"
12121219

1220+
"@types/hammerjs@^2.0.36":
1221+
version "2.0.36"
1222+
resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.36.tgz#17ce0a235e9ffbcdcdf5095646b374c2bf615a4c"
1223+
integrity sha512-7TUK/k2/QGpEAv/BCwSHlYu3NXZhQ9ZwBYpzr9tjlPIL2C5BeGhH3DmVavRx3ZNyELX5TLC91JTz/cen6AAtIQ==
1224+
12131225
"@types/minimatch@*":
12141226
version "3.0.3"
12151227
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
@@ -4388,7 +4400,7 @@ progress@^2.0.0:
43884400
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
43894401
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
43904402

4391-
prop-types@^15.5.10, prop-types@^15.6.2:
4403+
prop-types@^15.6.2, prop-types@^15.7.2:
43924404
version "15.7.2"
43934405
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
43944406
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -4445,14 +4457,15 @@ react-is@^16.8.1:
44454457
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.4.tgz#90f336a68c3a29a096a3d648ab80e87ec61482a2"
44464458
integrity sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA==
44474459

4448-
react-native-gesture-handler@^1.1.0:
4449-
version "1.1.0"
4450-
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.1.0.tgz#2a7d545ad2e0ca23adce22b2af441ad360ecccee"
4451-
integrity sha512-E9IKHpmL+sz/iCYkUriTUjBaQBORWV+oheYPQleADkxjo2sYsQfnlyTz4EQYFONkUwJ6WmfTNkYt2/yc5U4Ziw==
4460+
react-native-gesture-handler@^1.6.1:
4461+
version "1.6.1"
4462+
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.6.1.tgz#678e2dce250ed66e93af409759be22cd6375dd17"
4463+
integrity sha512-gQgIKhDiYf754yzhhliagLuLupvGb6ZyBdzYzr7aus3Fyi87TLOw63ers+r4kGw0h26oAWTAdHd34JnF4NeL6Q==
44524464
dependencies:
4465+
"@egjs/hammerjs" "^2.0.17"
44534466
hoist-non-react-statics "^2.3.1"
4454-
invariant "^2.2.2"
4455-
prop-types "^15.5.10"
4467+
invariant "^2.2.4"
4468+
prop-types "^15.7.2"
44564469

44574470
react-native-reanimated@^1.0.1:
44584471
version "1.7.0"

0 commit comments

Comments
 (0)