Skip to content

Commit 097580b

Browse files
Revert "fix: react-native-screens integration"
This reverts commit 144f034.
1 parent 71e82de commit 097580b

File tree

3 files changed

+49
-81
lines changed

3 files changed

+49
-81
lines changed

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"@react-navigation/native": "^6.0.10",
4848
"@release-it/conventional-changelog": "^5.0.0",
4949
"@types/jest": "^28.1.1",
50-
"@types/react": "^18.2.15",
51-
"@types/react-native": "^0.72.2",
50+
"@types/react": "~17.0.21",
51+
"@types/react-native": "0.67.8",
5252
"commitlint": "^17.0.2",
5353
"eslint": "^7.2.0",
5454
"eslint-config-prettier": "^8.5.0",
@@ -59,15 +59,13 @@
5959
"prettier": "^2.6.2",
6060
"react": "17.0.2",
6161
"react-native": "0.68.2",
62-
"react-native-screens": "^3.22.1",
6362
"react-native-builder-bob": "^0.18.2",
6463
"release-it": "^15.0.0",
6564
"typescript": "^4.7.3"
6665
},
6766
"peerDependencies": {
6867
"react": "*",
6968
"react-native": "*",
70-
"react-native-screens": "*",
7169
"@react-navigation/native": "*",
7270
"@gorhom/bottom-sheet": "*"
7371
},

src/BottomSheetView.tsx

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from '@gorhom/bottom-sheet';
88
import { ParamListBase, useTheme } from '@react-navigation/native';
99
import * as React from 'react';
10-
import { FullWindowOverlay } from 'react-native-screens';
1110
import type {
1211
BottomSheetDescriptorMap,
1312
BottomSheetNavigationConfig,
@@ -122,47 +121,45 @@ export function BottomSheetView({ state, descriptors }: Props) {
122121
<>
123122
{firstScreen.render()}
124123
{shouldRenderProvider.current && (
125-
<FullWindowOverlay>
126-
<BottomSheetModalProvider>
127-
{state.routes.slice(1).map((route) => {
128-
const { options, navigation, render } = descriptors[route.key];
129-
130-
const {
131-
index,
132-
backgroundStyle,
133-
handleIndicatorStyle,
134-
snapPoints = animatedSnapPoints.value,
135-
...sheetProps
136-
} = options;
137-
138-
return (
139-
<BottomSheetModalScreen
140-
key={route.key}
141-
// Make sure index is in range, it could be out if snapToIndex is persisted
142-
// and snapPoints is changed.
143-
index={Math.min(
144-
route.snapToIndex ?? index ?? 0,
145-
snapPoints.length - 1,
146-
)}
147-
contentHeight={animatedContentHeight}
148-
handleHeight={animatedHandleHeight}
149-
snapPoints={snapPoints}
150-
navigation={navigation}
151-
backgroundStyle={[themeBackgroundStyle, backgroundStyle]}
152-
handleIndicatorStyle={[
153-
themeHandleIndicatorStyle,
154-
handleIndicatorStyle,
155-
]}
156-
{...sheetProps}
157-
>
158-
<RNBottomSheetView onLayout={handleContentLayout}>
159-
{render()}
160-
</RNBottomSheetView>
161-
</BottomSheetModalScreen>
162-
);
163-
})}
164-
</BottomSheetModalProvider>
165-
</FullWindowOverlay>
124+
<BottomSheetModalProvider>
125+
{state.routes.slice(1).map((route) => {
126+
const { options, navigation, render } = descriptors[route.key];
127+
128+
const {
129+
index,
130+
backgroundStyle,
131+
handleIndicatorStyle,
132+
snapPoints = animatedSnapPoints.value,
133+
...sheetProps
134+
} = options;
135+
136+
return (
137+
<BottomSheetModalScreen
138+
key={route.key}
139+
// Make sure index is in range, it could be out if snapToIndex is persisted
140+
// and snapPoints is changed.
141+
index={Math.min(
142+
route.snapToIndex ?? index ?? 0,
143+
snapPoints.length - 1,
144+
)}
145+
contentHeight={animatedContentHeight}
146+
handleHeight={animatedHandleHeight}
147+
snapPoints={snapPoints}
148+
navigation={navigation}
149+
backgroundStyle={[themeBackgroundStyle, backgroundStyle]}
150+
handleIndicatorStyle={[
151+
themeHandleIndicatorStyle,
152+
handleIndicatorStyle,
153+
]}
154+
{...sheetProps}
155+
>
156+
<RNBottomSheetView onLayout={handleContentLayout}>
157+
{render()}
158+
</RNBottomSheetView>
159+
</BottomSheetModalScreen>
160+
);
161+
})}
162+
</BottomSheetModalProvider>
166163
)}
167164
</>
168165
);

yarn.lock

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,14 +1925,6 @@
19251925
resolved "https://registry.yarnpkg.com/@react-native/polyfills/-/polyfills-2.0.0.tgz#4c40b74655c83982c8cf47530ee7dc13d957b6aa"
19261926
integrity sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==
19271927

1928-
"@react-native/virtualized-lists@^0.72.4":
1929-
version "0.72.6"
1930-
resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.72.6.tgz#375f88a1371927d803afad8d8a0ede3261464030"
1931-
integrity sha512-JhT6ydu35LvbSKdwnhWDuGHMOwM0WAh9oza/X8vXHA8ELHRyQ/4p8eKz/bTQcbQziJaaleUURToGhFuCtgiMoA==
1932-
dependencies:
1933-
invariant "^2.2.4"
1934-
nullthrows "^1.1.1"
1935-
19361928
"@react-navigation/core@^6.2.1":
19371929
version "6.2.1"
19381930
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-6.2.1.tgz#90459f9afd25b71a9471b0706ebea2cdd2534fc4"
@@ -2184,12 +2176,11 @@
21842176
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
21852177
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
21862178

2187-
"@types/react-native@^0.72.2":
2188-
version "0.72.2"
2189-
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.72.2.tgz#27c931a899c555b28e20cdd12e570b017808de96"
2190-
integrity sha512-/eEjr04Zqo7mTMszuSdrLx90+j5nWhDMMOgtnKZfAYyV3RwmlpSb7F17ilmMMxZWJY81n/JZ4e6wdhMJFpjrCg==
2179+
"@types/react-native@0.67.8":
2180+
version "0.67.8"
2181+
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.67.8.tgz#edaaa0527b835fffbfc34c09874722b6e4a4d1f3"
2182+
integrity sha512-xA8rYiTHvO6RoZv/LFnmEeqRuhA2y34mGB8zX3bGHe/pCt9jEStUPyUO4q1KcDc9GiGIOBD8ArfRtThprAjSfQ==
21912183
dependencies:
2192-
"@react-native/virtualized-lists" "^0.72.4"
21932184
"@types/react" "*"
21942185

21952186
"@types/react@*":
@@ -2201,10 +2192,10 @@
22012192
"@types/scheduler" "*"
22022193
csstype "^3.0.2"
22032194

2204-
"@types/react@^18.2.15":
2205-
version "18.2.15"
2206-
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.15.tgz#14792b35df676c20ec3cf595b262f8c615a73066"
2207-
integrity sha512-oEjE7TQt1fFTFSbf8kkNuc798ahTUzn3Le67/PWjE8MAfYAD/qB7O8hSTcromLFqHCt9bcdOg5GXMokzTjJ5SA==
2195+
"@types/react@~17.0.21":
2196+
version "17.0.45"
2197+
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.45.tgz#9b3d5b661fd26365fefef0e766a1c6c30ccf7b3f"
2198+
integrity sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg==
22082199
dependencies:
22092200
"@types/prop-types" "*"
22102201
"@types/scheduler" "*"
@@ -7920,11 +7911,6 @@ react-devtools-core@^4.23.0:
79207911
shell-quote "^1.6.1"
79217912
ws "^7"
79227913

7923-
react-freeze@^1.0.0:
7924-
version "1.0.3"
7925-
resolved "https://registry.yarnpkg.com/react-freeze/-/react-freeze-1.0.3.tgz#5e3ca90e682fed1d73a7cb50c2c7402b3e85618d"
7926-
integrity sha512-ZnXwLQnGzrDpHBHiC56TXFXvmolPeMjTn1UOm610M4EXGzbEDR7oOIyS2ZiItgbs6eZc4oU/a0hpk8PrcKvv5g==
7927-
79287914
"react-is@^16.12.0 || ^17.0.0", react-is@^17.0.1:
79297915
version "17.0.2"
79307916
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
@@ -7991,14 +7977,6 @@ react-native-redash@^16.1.1:
79917977
normalize-svg-path "^1.0.1"
79927978
parse-svg-path "^0.1.2"
79937979

7994-
react-native-screens@^3.22.1:
7995-
version "3.22.1"
7996-
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.22.1.tgz#b0eb0696dbf1f9a852061cc71c0f8cdb95ed8e53"
7997-
integrity sha512-ffzwUdVKf+iLqhWSzN5DXBm0s2w5sN0P+TaHHPAx42LT7+DT0g8PkHT1QDvxpR5vCEPSS1i3EswyVK4HCuhTYg==
7998-
dependencies:
7999-
react-freeze "^1.0.0"
8000-
warn-once "^0.1.0"
8001-
80027980
80037981
version "0.68.2"
80047982
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.68.2.tgz#07547cd31bb9335a7fa4135cfbdc24e067142585"
@@ -9546,11 +9524,6 @@ walker@^1.0.7, walker@^1.0.8:
95469524
dependencies:
95479525
makeerror "1.0.12"
95489526

9549-
warn-once@^0.1.0:
9550-
version "0.1.1"
9551-
resolved "https://registry.yarnpkg.com/warn-once/-/warn-once-0.1.1.tgz#952088f4fb56896e73fd4e6a3767272a3fccce43"
9552-
integrity sha512-VkQZJbO8zVImzYFteBXvBOZEl1qL175WH8VmZcxF2fZAoudNhNDvHi+doCaAEdU2l2vtcIwa2zn0QK5+I1HQ3Q==
9553-
95549527
wcwidth@^1.0.1:
95559528
version "1.0.1"
95569529
resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8"

0 commit comments

Comments
 (0)