You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/upgrading-from-6.x.md
+130-10
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,9 @@ This guides lists all the breaking changes and new features in React Navigation
10
10
11
11
## Minimum Requirements
12
12
13
-
TODO
13
+
-`react-native` >= 0.72.0
14
+
-`expo` >= 49 (if you use Expo)
15
+
-`typescript` >= 5.0.0 (if you use TypeScript)
14
16
15
17
## Breaking changes
16
18
@@ -26,9 +28,7 @@ Due to these issues, we have a special API to navigate to a nested screen (`navi
26
28
From these release, this is no longer the default behavior. If you're relying on this behavior in your app, you can pass the `navigationInChildEnabled` prop to `NavigationContainer` to keep the behavior until you are able to migrate:
The `navigationInChildEnabled` prop will be removed in the next major.
@@ -116,6 +116,23 @@ So we've removed this prop instead of a `NavigationIndependentTree` component wh
116
116
117
117
This way, the responsibility no longer lies on the miniapp developer, but on the parent app. It's also harder for beginners to accidentally add this.
118
118
119
+
### The `theme` prop now accepts a `fonts` property
120
+
121
+
Previously, the `theme` prop on `NavigationContainer` accepted a `colors` property to customize the colors used by various UI elements from React Navigation. We have now added a `fonts` property to customize the fonts as well. If you are passing a custom theme in the `theme` prop, you'll need to update it to include the `fonts` property.
122
+
123
+
```diff
124
+
import { DefaultTheme } from '@react-navigation/native';
125
+
126
+
const theme = {
127
+
colors: {
128
+
// ...
129
+
},
130
+
+ fonts: DefaultTheme.fonts,
131
+
};
132
+
```
133
+
134
+
If you want to customize the fonts, see [the themes guide](themes.md) for more details.
135
+
119
136
### The `Link` component and `useLinkProps` hook now use screen names instead of paths
120
137
121
138
Previously, the `Link` component and `useLinkProps` hook were designed to work with path strings via the `to` prop. But it had few issues:
Note that this hook is intended to be used by custom navigators and not by end users. For end users, the `Link` component and `useLinkProps` are the recommended way to navigate.
154
171
172
+
### The flipper devtools plugin is now removed
173
+
174
+
Previously, we added a Flipper plugin for React Navigation to make debugging navigation easier. However, it has added significant maintenance overhead for us. The Flipper team hasn't been focused on React Native recently, so the overall experience of using Flipper with React Native has been poor.
175
+
176
+
> Currently, the Flipper team has been focused on native developer experience, so we are going back to the drawing board. We have created a newpillar within our team focused on Developer Experience. We are currently investigating improved Chrome Debugger protocol support from the Hermes team as well as migrating the debugging experience from Flipper to Chrome DevTools so we can deliver a debugging experience that meets our standard.
Since the React Native team migrating away from Flipper, it doesn't make much sense for us to spend additional resources to keep supporting it. So we've removed the Flipper plugin from `@react-navigation/devtools`.
181
+
182
+
### Various deprecated APIs are removed
183
+
184
+
We have removed all of the previously deprecated APIs. These APIs were deprecated in React Navigation 6 and showed a warning when used. So make sure that you have addressed all the warnings before upgrading.
185
+
186
+
Here is the full list of removed APIs:
187
+
188
+
-`@react-navigation/stack`
189
+
- Removed `mode` prop - use `presentation` option instead
190
+
- Removed `headerMode` prop - use `headerMode` and `headerShown` options instead
191
+
- Removed `keyboardHandlingEnabled` prop - use `keyboardHandlingEnabled` option instead
192
+
-`@react-navigation/drawer`
193
+
- Removed `openByDefault` prop - use `defaultStatus` prop instead
194
+
- Removed `lazy` prop - use `lazy` option instead
195
+
- Removed `drawerContentOptions` prop which contained following options:
196
+
-`drawerPosition`- use `drawerPosition` option instead
197
+
-`drawerType`- use `drawerType` option instead
198
+
-`edgeWidth`- use `swipeEdgeWidth` option instead
199
+
-`hideStatusBar`- use `drawerHideStatusBarOnOpen` option instead
200
+
-`keyboardDismissMode`- use `keyboardDismissMode` option instead
201
+
-`minSwipeDistance`- use `swipeMinDistance` option instead
202
+
-`overlayColor`- use `overlayColor` option instead
203
+
-`statusBarAnimation`- use `drawerStatusBarAnimation` option instead
204
+
-`gestureHandlerProps`- use `gestureHandlerProps` option instead
205
+
-`@react-navigation/bottom-tabs`
206
+
- Removed `lazy` prop - use `lazy` option instead
207
+
- Removed `tabBarOptions` prop which contained following options:
208
+
-`keyboardHidesTabBar`- use `tabBarHideOnKeyboard` option instead
209
+
-`activeTintColor`- use `tabBarActiveTintColor` option instead
210
+
-`inactiveTintColor`- use `tabBarInactiveTintColor` option instead
211
+
-`activeBackgroundColor`- use `tabBarActiveBackgroundColor` option instead
212
+
-`inactiveBackgroundColor`- use `tabBarInactiveBackgroundColor` option instead
213
+
-`allowFontScaling`- use `tabBarAllowFontScaling` option instead
214
+
-`showLabel`- use `tabBarShowLabel` option instead
215
+
-`labelStyle`- use `tabBarLabelStyle` option instead
216
+
-`iconStyle`- use `tabBarIconStyle` option instead
217
+
-`tabStyle`- use `tabBarItemStyle` option instead
218
+
-`labelPosition` and `adapative`- use `tabBarLabelPosition` option instead
219
+
-`tabBarVisible`- use `display: 'none'``tabBarStyle` option instead
220
+
-`@react-navigation/material-top-tabs`
221
+
- Removed `swipeEnabled` prop - use `swipeEnabled` option instead
222
+
- Removed `lazy` prop - use `lazy` option instead
223
+
- Removed `lazyPlaceholder` prop - use `lazyPlaceholder` option instead
224
+
- Removed `lazyPreloadDistance` prop - use `lazyPreloadDistance` option instead
225
+
- Removed `tabBarOptions` prop which contained following options:
226
+
-`renderBadge`- use `tabBarBadge` option instead
227
+
-`renderIndicator`- use `tabBarIndicator` option instead
228
+
-`activeTintColor`- use `tabBarActiveTintColor` option instead
229
+
-`inactiveTintColor`- use `tabBarInactiveTintColor` option instead
230
+
-`pressColor`- use `tabBarPressColor` option instead
231
+
-`pressOpacity`- use `tabBarPressOpacity` option instead
232
+
-`showLabel`- use `tabBarShowLabel` option instead
233
+
-`showIcon`- use `tabBarShowIcon` option instead
234
+
-`allowFontScaling`- use `tabBarAllowFontScaling` option instead
235
+
-`bounces`- use `tabBarBounces` option instead
236
+
-`scrollEnabled`- use `tabBarScrollEnabled` option instead
237
+
-`iconStyle`- use `tabBarIconStyle` option instead
238
+
-`labelStyle`- use `tabBarLabelStyle` option instead
239
+
-`tabStyle`- use `tabBarItemStyle` option instead
240
+
-`indicatorStyle`- use `tabBarIndicatorStyle` option instead
241
+
-`indicatorContainerStyle`- use `tabBarIndicatorContainerStyle` option instead
242
+
-`contentContainerStyle`- use `tabBarContentContainerStyle` option instead
243
+
-`style`- use `tabBarStyle` option instead
244
+
245
+
### `customAnimationOnGesture` is renamed to `animationMatchesGesture`in Native Stack Navigator
246
+
247
+
TODO
248
+
155
249
### Material Top Tab Navigator no longers requires installing `react-native-tab-view`
156
250
157
251
Previously, `@react-navigation/material-top-tabs` required installing `react-native-tab-view` as a dependency in the project. We have now moved thispackage to the React Navigation monorepo and able to coordinate the releases together, so it's no longer necessary to install it separately.
@@ -171,22 +265,48 @@ If you are using `@react-navigation/material-bottom-tabs` in your project, you c
171
265
+ import { createMaterialBottomTabNavigator } from 'react-native-paper/react-navigation';
172
266
```
173
267
174
-
### The flipper devtools plugin is now removed
268
+
### The `tabBarTestID` option is renamed to `tabBarButtonTestID` in Bottom Tab Navigator
175
269
176
-
Previously, we added a Flipper plugin for React Navigation to make debugging navigation easier. However, it has added significant maintenance overhead for us. The Flipper team hasn't been focused on React Native recently, so the overall experience of using Flipper with React Native has been poor.
270
+
TODO
177
271
178
-
> Currently, the Flipper team has been focused on native developer experience, so we are going back to the drawing board. We have created a newpillar within our team focused on Developer Experience. We are currently investigating improved Chrome Debugger protocol support from the Hermes team as well as migrating the debugging experience from Flipper to Chrome DevTools so we can deliver a debugging experience that meets our standard.
### Drawer Navigator no longer supports Reanimated 1
181
273
182
-
Since the React Native team migrating away from Flipper, it doesn't make much sense for us to spend additional resources to keep supporting it. So we've removed the Flipper plugin from `@react-navigation/devtools`.
274
+
TODO
183
275
184
276
## New features
185
277
186
278
### Navigators now support a static configuration API
187
279
188
280
TODO
189
281
282
+
### Support a top-level `path` configuration in linking config
283
+
284
+
TODO
285
+
286
+
### Support custom `layout` prop for Navigators
287
+
288
+
TODO
289
+
290
+
### Add experimental API for handling deep link after authentication
291
+
292
+
TODO
293
+
294
+
### Add a `Button` component to Elements
295
+
296
+
TODO
297
+
298
+
### Add `useAnimatedHeaderHeight` hook to Native Stack Navigator
299
+
300
+
TODO
301
+
302
+
### Bottom Tab Navigator now supports animations
303
+
304
+
TODO
305
+
306
+
### Bottom Tab Navigator can now show tabs on the side
307
+
308
+
TODO
309
+
190
310
### The drawer implementation is now available in `react-native-drawer-layout` as a standalone package
0 commit comments