File tree 14 files changed +9
-62
lines changed
packages/react-native-bottom-tabs
14 files changed +9
-62
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' react-native-bottom-tabs ' : minor
3
+ ---
4
+
5
+ feat!: remove ignoresTopSafeArea prop, safe area handling is now automatic
Original file line number Diff line number Diff line change @@ -31,10 +31,6 @@ import NativeBottomTabsUnmounting from './Examples/NativeBottomTabsUnmounting';
31
31
import NativeBottomTabsCustomTabBar from './Examples/NativeBottomTabsCustomTabBar' ;
32
32
import NativeBottomTabsFreezeOnBlur from './Examples/NativeBottomTabsFreezeOnBlur' ;
33
33
34
- const FourTabsIgnoreSafeArea = ( ) => {
35
- return < FourTabs ignoresTopSafeArea /> ;
36
- } ;
37
-
38
34
const HiddenTab = ( ) => {
39
35
return < FourTabs hideOneTab /> ;
40
36
} ;
@@ -89,12 +85,6 @@ const examples = [
89
85
name : 'Embedded stacks' ,
90
86
screenOptions : { headerShown : false } ,
91
87
} ,
92
- {
93
- component : FourTabsIgnoreSafeArea ,
94
- name : 'Four Tabs - No header' ,
95
- platform : 'ios' ,
96
- screenOptions : { headerShown : false } ,
97
- } ,
98
88
{
99
89
component : FourTabsRippleColor ,
100
90
name : 'Four Tabs with ripple Color' ,
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { Chat } from '../Screens/Chat';
7
7
import type { ColorValue } from 'react-native' ;
8
8
9
9
interface Props {
10
- ignoresTopSafeArea ?: boolean ;
11
10
disablePageAnimations ?: boolean ;
12
11
scrollEdgeAppearance ?: 'default' | 'opaque' | 'transparent' ;
13
12
backgroundColor ?: ColorValue ;
@@ -18,7 +17,6 @@ interface Props {
18
17
}
19
18
20
19
export default function FourTabs ( {
21
- ignoresTopSafeArea = false ,
22
20
disablePageAnimations = false ,
23
21
scrollEdgeAppearance = 'default' ,
24
22
backgroundColor,
@@ -64,7 +62,6 @@ export default function FourTabs({
64
62
65
63
return (
66
64
< TabView
67
- ignoresTopSafeArea = { ignoresTopSafeArea }
68
65
sidebarAdaptable
69
66
disablePageAnimations = { disablePageAnimations }
70
67
scrollEdgeAppearance = { scrollEdgeAppearance }
Original file line number Diff line number Diff line change @@ -118,11 +118,6 @@ A tab bar style that adapts to each platform:
118
118
- macOS/tvOS: Sidebar
119
119
- visionOS: Ornament with sidebar for secondary tabs
120
120
121
- #### ` ignoresTopSafeArea ` <Badge text =" iOS " type =" info " />
122
-
123
- Whether to ignore the top safe area.
124
- - Type: ` boolean `
125
-
126
121
#### ` disablePageAnimations ` <Badge text =" iOS " type =" info " />
127
122
128
123
Whether to disable animations between tabs.
Original file line number Diff line number Diff line change @@ -73,10 +73,6 @@ Optional unique ID for the navigator. This can be used with `navigation.getParen
73
73
74
74
The name of the route to render on first load of the navigator.
75
75
76
- #### ` ignoresTopSafeArea ` <Badge text = " iOS" type = " info" />
77
-
78
- Whether to ignore the top safe area. Defaults to ` true ` .
79
-
80
76
#### ` screenOptions `
81
77
82
78
Default options to use for the screens in the navigator.
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const Tabs = createNativeBottomTabNavigator();
21
21
22
22
function NativeBottomTabs() {
23
23
return (
24
- <Tabs.Navigator ignoresTopSafeArea >
24
+ <Tabs.Navigator >
25
25
<Tabs.Screen
26
26
name = " Home"
27
27
component = { HomeScreen }
Original file line number Diff line number Diff line change @@ -137,10 +137,6 @@ class RCTTabViewManager(context: ReactApplicationContext) : ViewGroupManager<Rea
137
137
fun setSidebarAdaptable (view : ReactBottomNavigationView , flag : Boolean ) {
138
138
}
139
139
140
- @ReactProp(name = " ignoresTopSafeArea" )
141
- fun setIgnoresTopSafeArea (view : ReactBottomNavigationView , flag : Boolean ) {
142
- }
143
-
144
140
@ReactProp(name = " hapticFeedbackEnabled" )
145
141
fun setHapticFeedbackEnabled (view : ReactBottomNavigationView , value : Boolean ) {
146
142
tabViewImpl.setHapticFeedbackEnabled(view, value)
Original file line number Diff line number Diff line change @@ -119,10 +119,6 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
119
119
_tabViewProvider.labeled = newViewProps.labeled ;
120
120
}
121
121
122
- if (oldViewProps.ignoresTopSafeArea != newViewProps.ignoresTopSafeArea ) {
123
- _tabViewProvider.ignoresTopSafeArea = newViewProps.ignoresTopSafeArea ;
124
- }
125
-
126
122
if (oldViewProps.selectedPage != newViewProps.selectedPage ) {
127
123
_tabViewProvider.selectedPage = RCTNSStringFromString (newViewProps.selectedPage );
128
124
}
@@ -162,7 +158,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
162
158
if (oldViewProps.fontFamily != newViewProps.fontFamily ) {
163
159
_tabViewProvider.fontFamily = RCTNSStringFromStringNilIfEmpty (newViewProps.fontFamily );
164
160
}
165
-
161
+
166
162
if (oldViewProps.tabBarHidden != newViewProps.tabBarHidden ) {
167
163
_tabViewProvider.tabBarHidden = newViewProps.tabBarHidden ;
168
164
}
Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ @implementation RCTTabView
32
32
RCT_EXPORT_VIEW_PROPERTY(icons, NSArray <RCTImageSource *>);
33
33
RCT_EXPORT_VIEW_PROPERTY (sidebarAdaptable, BOOL )
34
34
RCT_EXPORT_VIEW_PROPERTY(labeled, BOOL )
35
- RCT_EXPORT_VIEW_PROPERTY(ignoresTopSafeArea, BOOL )
36
35
RCT_EXPORT_VIEW_PROPERTY(disablePageAnimations, BOOL )
37
36
RCT_EXPORT_VIEW_PROPERTY(scrollEdgeAppearance, NSString )
38
37
RCT_EXPORT_VIEW_PROPERTY(translucent, BOOL )
Original file line number Diff line number Diff line change @@ -86,9 +86,7 @@ struct TabViewImpl: View {
86
86
let icon = props. icons [ index]
87
87
88
88
RepresentableView ( view: child)
89
- . ignoresTopSafeArea (
90
- props. ignoresTopSafeArea
91
- )
89
+ . ignoresSafeArea ( . all, edges: . all)
92
90
. tabItem {
93
91
TabItem (
94
92
title: tabData? . title,
@@ -290,19 +288,6 @@ extension View {
290
288
}
291
289
}
292
290
293
- @ViewBuilder
294
- func ignoresTopSafeArea(
295
- _ flag: Bool
296
- ) -> some View {
297
- if flag {
298
- self
299
- . ignoresSafeArea ( . container, edges: . all)
300
- } else {
301
- self
302
- . ignoresSafeArea ( . container, edges: . bottom)
303
- }
304
- }
305
-
306
291
#if !os(macOS)
307
292
@ViewBuilder
308
293
func configureAppearance( props: TabViewProps , tabBar: UITabBar ? ) -> some View {
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ class TabViewProps: ObservableObject {
15
15
@Published var activeTintColor : PlatformColor ?
16
16
@Published var inactiveTintColor : PlatformColor ?
17
17
@Published var translucent : Bool = true
18
- @Published var ignoresTopSafeArea : Bool = true
19
18
@Published var disablePageAnimations : Bool = false
20
19
@Published var hapticFeedbackEnabled : Bool = false
21
20
@Published var fontSize : Int ?
Original file line number Diff line number Diff line change @@ -85,12 +85,6 @@ public final class TabInfo: NSObject {
85
85
}
86
86
}
87
87
88
- @objc public var ignoresTopSafeArea : Bool = true {
89
- didSet {
90
- props. ignoresTopSafeArea = ignoresTopSafeArea
91
- }
92
- }
93
-
94
88
@objc public var selectedPage : NSString ? {
95
89
didSet {
96
90
props. selectedPage = selectedPage as? String
@@ -156,7 +150,7 @@ public final class TabInfo: NSObject {
156
150
props. fontSize = fontSize as? Int
157
151
}
158
152
}
159
-
153
+
160
154
@objc public var tabBarHidden : Bool = false {
161
155
didSet {
162
156
props. tabBarHidden = tabBarHidden
Original file line number Diff line number Diff line change @@ -36,10 +36,6 @@ interface Props<Route extends BaseRoute> {
36
36
* - visionOS shows an ornament and also shows a sidebar for secondary tabs within a `TabSection`.
37
37
*/
38
38
sidebarAdaptable ?: boolean ;
39
- /**
40
- * Whether to ignore the top safe area. (iOS only)
41
- */
42
- ignoresTopSafeArea ?: boolean ;
43
39
/**
44
40
* Whether to disable page animations between tabs. (iOS only) Defaults to `false`.
45
41
*/
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ export interface TabViewProps extends ViewProps {
49
49
rippleColor ?: ColorValue ;
50
50
activeTintColor ?: ColorValue ;
51
51
inactiveTintColor ?: ColorValue ;
52
- ignoresTopSafeArea ?: WithDefault < boolean , true > ;
53
52
disablePageAnimations ?: boolean ;
54
53
activeIndicatorColor ?: ColorValue ;
55
54
hapticFeedbackEnabled ?: boolean ;
You can’t perform that action at this time.
0 commit comments