Skip to content

Commit 7855b14

Browse files
committed
Revert "feat: implement freezeOnBlur (#207)"
This reverts commit c9f13ad.
1 parent 6e19b1a commit 7855b14

File tree

10 files changed

+7
-190
lines changed

10 files changed

+7
-190
lines changed

apps/example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ PODS:
12091209
- ReactCommon/turbomodule/bridging
12101210
- ReactCommon/turbomodule/core
12111211
- Yoga
1212-
- react-native-bottom-tabs (0.7.6):
1212+
- react-native-bottom-tabs (0.7.3):
12131213
- DoubleConversion
12141214
- glog
12151215
- RCT-Folly (= 2024.01.01.00)
@@ -1222,7 +1222,7 @@ PODS:
12221222
- React-graphics
12231223
- React-ImageManager
12241224
- React-jsi
1225-
- react-native-bottom-tabs/common (= 0.7.6)
1225+
- react-native-bottom-tabs/common (= 0.7.3)
12261226
- React-NativeModulesApple
12271227
- React-RCTFabric
12281228
- React-rendererdebug
@@ -1234,7 +1234,7 @@ PODS:
12341234
- SDWebImageSVGCoder (>= 1.7.0)
12351235
- SwiftUIIntrospect (~> 1.0)
12361236
- Yoga
1237-
- react-native-bottom-tabs/common (0.7.6):
1237+
- react-native-bottom-tabs/common (0.7.3):
12381238
- DoubleConversion
12391239
- glog
12401240
- RCT-Folly (= 2024.01.01.00)
@@ -1943,7 +1943,7 @@ SPEC CHECKSUMS:
19431943
React-logger: d79b704bf215af194f5213a6b7deec50ba8e6a9b
19441944
React-Mapbuffer: b982d5bba94a8bc073bda48f0d27c9b28417fae3
19451945
React-microtasksnativemodule: 8fa285fed833a04a754bf575f8ded65fc240b88d
1946-
react-native-bottom-tabs: 084cfd4d4b1e74c03f4196b3f62d39445882f45f
1946+
react-native-bottom-tabs: b6b3dc2e971c860a0a6d763701929d1899f666a0
19471947
react-native-safe-area-context: 73505107f7c673cd550a561aeb6271f152c483b6
19481948
React-nativeconfig: 8c83d992b9cc7d75b5abe262069eaeea4349f794
19491949
React-NativeModulesApple: b8465afc883f5bf3fe8bac3767e394d581a5f123

apps/example/src/App.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import TintColorsExample from './Examples/TintColors';
2727
import NativeBottomTabsEmbeddedStacks from './Examples/NativeBottomTabsEmbeddedStacks';
2828
import NativeBottomTabsSVGs from './Examples/NativeBottomTabsSVGs';
2929
import NativeBottomTabsRemoteIcons from './Examples/NativeBottomTabsRemoteIcons';
30-
import NativeBottomTabsFreezeOnBlur from './Examples/NativeBottomTabsFreezeOnBlur';
3130

3231
const FourTabsIgnoreSafeArea = () => {
3332
return <FourTabs ignoresTopSafeArea />;
@@ -103,10 +102,6 @@ const examples = [
103102
name: 'Four Tabs - Transparent scroll edge appearance',
104103
platform: 'ios',
105104
},
106-
{
107-
component: NativeBottomTabsFreezeOnBlur,
108-
name: 'Native Bottom Tabs with freezeOnBlur',
109-
},
110105
{
111106
component: FourTabsOpaqueScrollEdgeAppearance,
112107
name: 'Four Tabs - Opaque scroll edge appearance',

apps/example/src/Examples/NativeBottomTabsFreezeOnBlur.tsx

Lines changed: 0 additions & 115 deletions
This file was deleted.

packages/react-native-bottom-tabs/package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,11 @@
7777
"react": "18.3.1",
7878
"react-native": "0.75.4",
7979
"react-native-builder-bob": "^0.32.1",
80-
"react-native-screens": "4.3.0",
8180
"typescript": "^5.2.2"
8281
},
8382
"peerDependencies": {
8483
"react": "*",
85-
"react-native": "*",
86-
"react-native-screens": ">=3.29.0"
87-
},
88-
"peerDependenciesMeta": {
89-
"react-native-screens": {
90-
"optional": true
91-
}
84+
"react-native": "*"
9285
},
9386
"react-native-builder-bob": {
9487
"source": "src",

packages/react-native-bottom-tabs/src/Screen.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

packages/react-native-bottom-tabs/src/TabView.tsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
1515
import TabViewAdapter from './TabViewAdapter';
1616
import useLatestCallback from 'use-latest-callback';
1717
import type { BaseRoute, NavigationState } from './types';
18-
import { Screen } from './Screen';
1918

2019
const isAppleSymbol = (icon: any): icon is { sfSymbol: string } =>
2120
icon?.sfSymbol;
@@ -117,13 +116,6 @@ interface Props<Route extends BaseRoute> {
117116
*/
118117
getTestID?: (props: { route: Route }) => string | undefined;
119118

120-
/**
121-
* Get freezeOnBlur for the current screen. Uses false by default.
122-
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
123-
*
124-
*/
125-
getFreezeOnBlur?: (props: { route: Route }) => boolean | undefined;
126-
127119
/**
128120
* Background color of the tab bar.
129121
*/
@@ -168,7 +160,6 @@ const TabView = <Route extends BaseRoute>({
168160
tabBarInactiveTintColor: inactiveTintColor,
169161
getLazy = ({ route }: { route: Route }) => route.lazy,
170162
getLabelText = ({ route }: { route: Route }) => route.title,
171-
getFreezeOnBlur = ({ route }: { route: Route }) => route.freezeOnBlur,
172163
getIcon = ({ route, focused }: { route: Route; focused: boolean }) =>
173164
route.unfocusedIcon
174165
? focused
@@ -320,14 +311,11 @@ const TabView = <Route extends BaseRoute>({
320311
const focused = route.key === focusedKey;
321312
const opacity = focused ? 1 : 0;
322313
const zIndex = focused ? 0 : -1;
323-
const freezeOnBlur = getFreezeOnBlur({ route });
324314

325315
return (
326-
<Screen
316+
<View
327317
key={route.key}
328318
collapsable={false}
329-
visible={focused}
330-
freezeOnBlur={freezeOnBlur}
331319
pointerEvents={focused ? 'auto' : 'none'}
332320
accessibilityElementsHidden={!focused}
333321
importantForAccessibility={
@@ -343,7 +331,7 @@ const TabView = <Route extends BaseRoute>({
343331
route,
344332
jumpTo,
345333
})}
346-
</Screen>
334+
</View>
347335
);
348336
})}
349337
</TabViewAdapter>

packages/react-native-bottom-tabs/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export type BaseRoute = {
1515
activeTintColor?: string;
1616
hidden?: boolean;
1717
testID?: string;
18-
freezeOnBlur?: boolean;
1918
};
2019

2120
export type NavigationState<Route extends BaseRoute> = {

packages/react-navigation/src/types.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ export type NativeBottomTabNavigationOptions = {
9191
* TestID for the tab.
9292
*/
9393
tabBarButtonTestID?: string;
94-
95-
/**
96-
* Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
97-
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
98-
*
99-
* Only supported on iOS and Android.
100-
*/
101-
freezeOnBlur?: boolean;
10294
};
10395

10496
export type NativeBottomTabDescriptor = Descriptor<
@@ -125,6 +117,5 @@ export type NativeBottomTabNavigationConfig = Partial<
125117
| 'onTabLongPress'
126118
| 'getActiveTintColor'
127119
| 'getTestID'
128-
| 'getFreezeOnBlur'
129120
>
130121
>;

packages/react-navigation/src/views/NativeBottomTabView.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ export default function NativeBottomTabView({
4545
const options = descriptors[route.key]?.options;
4646
return options?.tabBarItemHidden === true;
4747
}}
48-
getFreezeOnBlur={({ route }) =>
49-
descriptors[route.key]?.options.freezeOnBlur
50-
}
5148
getTestID={({ route }) =>
5249
descriptors[route.key]?.options.tabBarButtonTestID
5350
}

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15614,17 +15614,12 @@ __metadata:
1561415614
react: 18.3.1
1561515615
react-native: 0.75.4
1561615616
react-native-builder-bob: ^0.32.1
15617-
react-native-screens: 4.3.0
1561815617
sf-symbols-typescript: ^2.0.0
1561915618
typescript: ^5.2.2
1562015619
use-latest-callback: ^0.2.1
1562115620
peerDependencies:
1562215621
react: "*"
1562315622
react-native: "*"
15624-
react-native-screens: ">=3.29.0"
15625-
peerDependenciesMeta:
15626-
react-native-screens:
15627-
optional: true
1562815623
languageName: unknown
1562915624
linkType: soft
1563015625

0 commit comments

Comments
 (0)