Skip to content

Commit b8cbd28

Browse files
authored
feat!: remove ignoresTopSafeArea prop (#332)
* fix: tvOS measurements * feat!: remove ignoresTopSafeArea
1 parent 08cec90 commit b8cbd28

File tree

15 files changed

+15
-68
lines changed

15 files changed

+15
-68
lines changed

.changeset/twelve-rules-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-native-bottom-tabs': minor
3+
---
4+
5+
feat!: remove ignoresTopSafeArea prop, safe area handling is now automatic

apps/example/src/App.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ import NativeBottomTabsUnmounting from './Examples/NativeBottomTabsUnmounting';
3131
import NativeBottomTabsCustomTabBar from './Examples/NativeBottomTabsCustomTabBar';
3232
import NativeBottomTabsFreezeOnBlur from './Examples/NativeBottomTabsFreezeOnBlur';
3333

34-
const FourTabsIgnoreSafeArea = () => {
35-
return <FourTabs ignoresTopSafeArea />;
36-
};
37-
3834
const HiddenTab = () => {
3935
return <FourTabs hideOneTab />;
4036
};
@@ -89,12 +85,6 @@ const examples = [
8985
name: 'Embedded stacks',
9086
screenOptions: { headerShown: false },
9187
},
92-
{
93-
component: FourTabsIgnoreSafeArea,
94-
name: 'Four Tabs - No header',
95-
platform: 'ios',
96-
screenOptions: { headerShown: false },
97-
},
9888
{
9989
component: FourTabsRippleColor,
10090
name: 'Four Tabs with ripple Color',

apps/example/src/Examples/FourTabs.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Chat } from '../Screens/Chat';
77
import type { ColorValue } from 'react-native';
88

99
interface Props {
10-
ignoresTopSafeArea?: boolean;
1110
disablePageAnimations?: boolean;
1211
scrollEdgeAppearance?: 'default' | 'opaque' | 'transparent';
1312
backgroundColor?: ColorValue;
@@ -18,7 +17,6 @@ interface Props {
1817
}
1918

2019
export default function FourTabs({
21-
ignoresTopSafeArea = false,
2220
disablePageAnimations = false,
2321
scrollEdgeAppearance = 'default',
2422
backgroundColor,
@@ -64,7 +62,6 @@ export default function FourTabs({
6462

6563
return (
6664
<TabView
67-
ignoresTopSafeArea={ignoresTopSafeArea}
6865
sidebarAdaptable
6966
disablePageAnimations={disablePageAnimations}
7067
scrollEdgeAppearance={scrollEdgeAppearance}

docs/docs/docs/guides/standalone-usage.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ A tab bar style that adapts to each platform:
118118
- macOS/tvOS: Sidebar
119119
- visionOS: Ornament with sidebar for secondary tabs
120120

121-
#### `ignoresTopSafeArea` <Badge text="iOS" type="info" />
122-
123-
Whether to ignore the top safe area.
124-
- Type: `boolean`
125-
126121
#### `disablePageAnimations` <Badge text="iOS" type="info" />
127122

128123
Whether to disable animations between tabs.

docs/docs/docs/guides/usage-with-react-navigation.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ Optional unique ID for the navigator. This can be used with `navigation.getParen
7373

7474
The name of the route to render on first load of the navigator.
7575

76-
#### `ignoresTopSafeArea` <Badge text="iOS" type="info" />
77-
78-
Whether to ignore the top safe area. Defaults to `true`.
79-
8076
#### `screenOptions`
8177

8278
Default options to use for the screens in the navigator.

docs/docs/docs/guides/usage-with-vector-icons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Tabs = createNativeBottomTabNavigator();
2121

2222
function NativeBottomTabs() {
2323
return (
24-
<Tabs.Navigator ignoresTopSafeArea>
24+
<Tabs.Navigator>
2525
<Tabs.Screen
2626
name="Home"
2727
component={HomeScreen}

packages/react-native-bottom-tabs/android/src/oldarch/RCTTabViewManager.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ class RCTTabViewManager(context: ReactApplicationContext) : ViewGroupManager<Rea
137137
fun setSidebarAdaptable(view: ReactBottomNavigationView, flag: Boolean) {
138138
}
139139

140-
@ReactProp(name = "ignoresTopSafeArea")
141-
fun setIgnoresTopSafeArea(view: ReactBottomNavigationView, flag: Boolean) {
142-
}
143-
144140
@ReactProp(name = "hapticFeedbackEnabled")
145141
fun setHapticFeedbackEnabled(view: ReactBottomNavigationView, value: Boolean) {
146142
tabViewImpl.setHapticFeedbackEnabled(view, value)

packages/react-native-bottom-tabs/ios/Extensions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension PlatformImage {
5454
}
5555

5656
extension View {
57-
57+
5858
#if os(macOS)
5959
@MainActor
6060
@ViewBuilder
@@ -81,8 +81,8 @@ extension View {
8181
#endif
8282
}
8383
#endif
84-
85-
84+
85+
8686
@MainActor
8787
@ViewBuilder
8888
func measureView(onLayout: @escaping (_ size: CGSize) -> Void) -> some View {
@@ -97,7 +97,7 @@ extension View {
9797
onLayout(geometry.size)
9898
}
9999
}
100-
.ignoresSafeArea(.all, edges: .vertical)
100+
.ignoresSafeArea(.all, edges: .all)
101101
)
102102
}
103103
}

packages/react-native-bottom-tabs/ios/Fabric/RCTTabViewComponentView.mm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
119119
_tabViewProvider.labeled = newViewProps.labeled;
120120
}
121121

122-
if (oldViewProps.ignoresTopSafeArea != newViewProps.ignoresTopSafeArea) {
123-
_tabViewProvider.ignoresTopSafeArea = newViewProps.ignoresTopSafeArea;
124-
}
125-
126122
if (oldViewProps.selectedPage != newViewProps.selectedPage) {
127123
_tabViewProvider.selectedPage = RCTNSStringFromString(newViewProps.selectedPage);
128124
}
@@ -162,7 +158,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
162158
if (oldViewProps.fontFamily != newViewProps.fontFamily) {
163159
_tabViewProvider.fontFamily = RCTNSStringFromStringNilIfEmpty(newViewProps.fontFamily);
164160
}
165-
161+
166162
if (oldViewProps.tabBarHidden != newViewProps.tabBarHidden) {
167163
_tabViewProvider.tabBarHidden = newViewProps.tabBarHidden;
168164
}

packages/react-native-bottom-tabs/ios/RCTTabViewViewManager.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ @implementation RCTTabView
3232
RCT_EXPORT_VIEW_PROPERTY(icons, NSArray<RCTImageSource *>);
3333
RCT_EXPORT_VIEW_PROPERTY(sidebarAdaptable, BOOL)
3434
RCT_EXPORT_VIEW_PROPERTY(labeled, BOOL)
35-
RCT_EXPORT_VIEW_PROPERTY(ignoresTopSafeArea, BOOL)
3635
RCT_EXPORT_VIEW_PROPERTY(disablePageAnimations, BOOL)
3736
RCT_EXPORT_VIEW_PROPERTY(scrollEdgeAppearance, NSString)
3837
RCT_EXPORT_VIEW_PROPERTY(translucent, BOOL)

0 commit comments

Comments
 (0)