@react-navigation/drawer 8.0.0-alpha.3 → 8.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/module/index.js.map +1 -1
  2. package/lib/module/navigators/createDrawerNavigator.js +3 -7
  3. package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
  4. package/lib/module/utils/useDrawerStatus.js +1 -1
  5. package/lib/module/utils/useDrawerStatus.js.map +1 -1
  6. package/lib/module/views/DrawerContentScrollView.js +30 -13
  7. package/lib/module/views/DrawerContentScrollView.js.map +1 -1
  8. package/lib/module/views/DrawerItem.js +50 -8
  9. package/lib/module/views/DrawerItem.js.map +1 -1
  10. package/lib/module/views/DrawerItemList.js +3 -1
  11. package/lib/module/views/DrawerItemList.js.map +1 -1
  12. package/lib/module/views/DrawerToggleButton.js +37 -7
  13. package/lib/module/views/DrawerToggleButton.js.map +1 -1
  14. package/lib/module/views/DrawerView.js +14 -15
  15. package/lib/module/views/DrawerView.js.map +1 -1
  16. package/lib/typescript/src/index.d.ts +1 -1
  17. package/lib/typescript/src/index.d.ts.map +1 -1
  18. package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +8 -14
  19. package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
  20. package/lib/typescript/src/types.d.ts +20 -17
  21. package/lib/typescript/src/types.d.ts.map +1 -1
  22. package/lib/typescript/src/views/DrawerContentScrollView.d.ts +5 -2
  23. package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
  24. package/lib/typescript/src/views/DrawerItem.d.ts +18 -17
  25. package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
  26. package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -1
  27. package/lib/typescript/src/views/DrawerToggleButton.d.ts +12 -7
  28. package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
  29. package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
  30. package/package.json +24 -24
  31. package/src/index.tsx +1 -0
  32. package/src/navigators/createDrawerNavigator.tsx +9 -40
  33. package/src/types.tsx +26 -20
  34. package/src/utils/useDrawerStatus.tsx +1 -1
  35. package/src/views/DrawerContentScrollView.tsx +31 -15
  36. package/src/views/DrawerItem.tsx +84 -23
  37. package/src/views/DrawerItemList.tsx +2 -0
  38. package/src/views/DrawerToggleButton.tsx +66 -22
  39. package/src/views/DrawerView.tsx +18 -18
  40. package/lib/module/views/assets/toggle-drawer-icon@1x.android.png +0 -0
  41. package/lib/module/views/assets/toggle-drawer-icon@1x.ios.png +0 -0
  42. package/lib/module/views/assets/toggle-drawer-icon@2x.android.png +0 -0
  43. package/lib/module/views/assets/toggle-drawer-icon@2x.ios.png +0 -0
  44. package/lib/module/views/assets/toggle-drawer-icon@3x.android.png +0 -0
  45. package/lib/module/views/assets/toggle-drawer-icon@3x.ios.png +0 -0
  46. package/lib/module/views/assets/toggle-drawer-icon@4x.android.png +0 -0
  47. package/lib/module/views/assets/toggle-drawer-icon@4x.ios.png +0 -0
  48. package/src/views/assets/toggle-drawer-icon@1x.android.png +0 -0
  49. package/src/views/assets/toggle-drawer-icon@1x.ios.png +0 -0
  50. package/src/views/assets/toggle-drawer-icon@2x.android.png +0 -0
  51. package/src/views/assets/toggle-drawer-icon@2x.ios.png +0 -0
  52. package/src/views/assets/toggle-drawer-icon@3x.android.png +0 -0
  53. package/src/views/assets/toggle-drawer-icon@3x.ios.png +0 -0
  54. package/src/views/assets/toggle-drawer-icon@4x.android.png +0 -0
  55. package/src/views/assets/toggle-drawer-icon@4x.ios.png +0 -0
@@ -1,4 +1,5 @@
1
- import type { HeaderOptions } from '@react-navigation/elements';
1
+ import type { HeaderOptions, Icon } from '@react-navigation/elements';
2
+ import type { Screen } from '@react-navigation/elements/internal';
2
3
  import type { DefaultNavigatorOptions, Descriptor, DrawerActionHelpers, DrawerNavigationState, DrawerRouterOptions, NavigationHelpers, NavigationProp, ParamListBase, Route, RouteProp, Theme } from '@react-navigation/native';
3
4
  import type { ColorValue, StyleProp, TextStyle, ViewStyle } from 'react-native';
4
5
  import type { PanGesture } from 'react-native-gesture-handler';
@@ -17,12 +18,6 @@ export type DrawerNavigationConfig = {
17
18
  * Defaults to `DrawerContent`.
18
19
  */
19
20
  drawerContent?: (props: DrawerContentComponentProps) => React.ReactNode;
20
- /**
21
- * Whether inactive screens should be detached from the view hierarchy to save memory.
22
- * Make sure to call `enableScreens` from `react-native-screens` to make it work.
23
- * Defaults to `true`.
24
- */
25
- detachInactiveScreens?: boolean;
26
21
  };
27
22
  export type DrawerNavigationOptions = HeaderOptions & {
28
23
  /**
@@ -53,13 +48,13 @@ export type DrawerNavigationOptions = HeaderOptions & {
53
48
  focused: boolean;
54
49
  }) => React.ReactNode);
55
50
  /**
56
- * A function that given { focused: boolean, color: ColorValue } returns a React.Node to display an icon the drawer.
51
+ * Icon to display for the drawer item.
57
52
  */
58
- drawerIcon?: (props: {
53
+ drawerIcon?: Icon | ((props: {
59
54
  color: ColorValue;
60
55
  size: number;
61
56
  focused: boolean;
62
- }) => React.ReactNode;
57
+ }) => Icon | React.ReactNode);
63
58
  /**
64
59
  * Color for the icon and label in the active item in the drawer.
65
60
  */
@@ -84,6 +79,10 @@ export type DrawerNavigationOptions = HeaderOptions & {
84
79
  * Style object for the single item, which can contain an icon and/or a label.
85
80
  */
86
81
  drawerItemStyle?: StyleProp<ViewStyle>;
82
+ /**
83
+ * ID to locate this drawer item in tests.
84
+ */
85
+ drawerItemTestID?: string;
87
86
  /**
88
87
  * Style object to apply to the `Text` inside content section which renders a label.
89
88
  */
@@ -114,7 +113,7 @@ export type DrawerNavigationOptions = HeaderOptions & {
114
113
  *
115
114
  * Defaults to `slide` on iOS and `front` on other platforms.
116
115
  */
117
- drawerType?: 'front' | 'back' | 'slide' | 'permanent';
116
+ drawerType?: 'front' | 'back' | 'slide' | 'permanent' | undefined;
118
117
  /**
119
118
  * Whether the statusbar should be hidden when the drawer is pulled or opens,
120
119
  */
@@ -136,7 +135,7 @@ export type DrawerNavigationOptions = HeaderOptions & {
136
135
  /**
137
136
  * Style object for the component wrapping the screen content.
138
137
  */
139
- sceneStyle?: StyleProp<ViewStyle>;
138
+ sceneStyle?: React.ComponentProps<typeof Screen>['style'];
140
139
  /**
141
140
  * Function to modify the pan gesture handler via RNGH properties API.
142
141
  */
@@ -167,13 +166,17 @@ export type DrawerNavigationOptions = HeaderOptions & {
167
166
  */
168
167
  popToTopOnBlur?: boolean;
169
168
  /**
170
- * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
171
- * Defaults to `true` when `enableFreeze()` is run at the top of the application.
172
- * Requires `react-native-screens` version >=3.16.0.
169
+ * What should happen when screens become inactive.
170
+ * - `pause`: Effects are cleaned up.
171
+ * - `none`: Screen renders normally
172
+ *
173
+ * Defaults to `pause`.
173
174
  *
174
- * Only supported on iOS and Android.
175
+ * If you set `lazy: false` or preload a screen,
176
+ * It won't be paused until after the first time it becomes focused.
177
+ * This makes sure that effects are run to initialize the screen.
175
178
  */
176
- freezeOnBlur?: boolean;
179
+ inactiveBehavior?: 'pause' | 'none';
177
180
  };
178
181
  export type DrawerContentComponentProps = {
179
182
  state: DrawerNavigationState<ParamListBase>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EACV,uBAAuB,EACvB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,KAAK,EACL,SAAS,EACT,KAAK,EACN,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAA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U,KAAK,UAAU,CAAC;IAC9D,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,mBAAmB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC3C,kBAAkB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAC1C,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CACxD,aAAa,EACb,qBAAqB,CAAC,aAAa,CAAC,EACpC,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,CAAC,aAAa,CAAC,CACpC,GACC,mBAAmB,GACnB,sBAAsB,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { ScrollView, type ScrollViewProps } from 'react-native';
3
- export declare const DrawerContentScrollView: React.ForwardRefExoticComponent<ScrollViewProps & {
3
+ type Props = ScrollViewProps & {
4
4
  children: React.ReactNode;
5
- } & React.RefAttributes<ScrollView>>;
5
+ ref?: React.Ref<ScrollView>;
6
+ };
7
+ export declare function DrawerContentScrollView({ contentInsetAdjustmentBehavior, contentContainerStyle, style, children, ref, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
6
9
  //# sourceMappingURL=DrawerContentScrollView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAc,MAAM,cAAc,CAAC;AA4C5E,eAAO,MAAM,uBAAuB;cAtCxB,KAAK,CAAC,SAAS;oCAwC1B,CAAC"}
1
+ {"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,UAAU,EACV,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAKtB,KAAK,KAAK,GAAG,eAAe,GAAG;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;CAC7B,CAAC;AAIF,wBAAgB,uBAAuB,CAAC,EACtC,8BAA4C,EAC5C,qBAAqB,EACrB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,KAAK,2CAsCP"}
@@ -1,15 +1,16 @@
1
+ import { type Icon } from '@react-navigation/elements';
1
2
  import { type Route } from '@react-navigation/native';
2
- import * as React from 'react';
3
+ import React from 'react';
3
4
  import { type ColorValue, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
4
5
  type Props = {
5
6
  /**
6
7
  * The route object which should be specified by the drawer item.
7
8
  */
8
- route?: Route<string>;
9
+ route?: Route<string> | undefined;
9
10
  /**
10
11
  * The `href` to use for the anchor tag on web
11
12
  */
12
- href?: string;
13
+ href?: string | undefined;
13
14
  /**
14
15
  * The label text of the item.
15
16
  */
@@ -20,15 +21,15 @@ type Props = {
20
21
  /**
21
22
  * Icon to display for the `DrawerItem`.
22
23
  */
23
- icon?: (props: {
24
+ icon?: Icon | ((props: {
24
25
  focused: boolean;
25
26
  size: number;
26
27
  color: ColorValue;
27
- }) => React.ReactNode;
28
+ }) => Icon | React.ReactNode) | undefined;
28
29
  /**
29
30
  * Whether to highlight the drawer item as active.
30
31
  */
31
- focused?: boolean;
32
+ focused?: boolean | undefined;
32
33
  /**
33
34
  * Function to execute on press.
34
35
  */
@@ -36,53 +37,53 @@ type Props = {
36
37
  /**
37
38
  * Color for the icon and label when the item is active.
38
39
  */
39
- activeTintColor?: ColorValue;
40
+ activeTintColor?: ColorValue | undefined;
40
41
  /**
41
42
  * Color for the icon and label when the item is inactive.
42
43
  */
43
- inactiveTintColor?: ColorValue;
44
+ inactiveTintColor?: ColorValue | undefined;
44
45
  /**
45
46
  * Background color for item when its active.
46
47
  */
47
- activeBackgroundColor?: ColorValue;
48
+ activeBackgroundColor?: ColorValue | undefined;
48
49
  /**
49
50
  * Background color for item when its inactive.
50
51
  */
51
- inactiveBackgroundColor?: ColorValue;
52
+ inactiveBackgroundColor?: ColorValue | undefined;
52
53
  /**
53
54
  * Color of the touchable effect on press.
54
55
  * Only supported on Android.
55
56
  *
56
57
  * @platform android
57
58
  */
58
- pressColor?: ColorValue;
59
+ pressColor?: ColorValue | undefined;
59
60
  /**
60
61
  * Opacity of the touchable effect on press.
61
62
  * Only supported on iOS.
62
63
  *
63
64
  * @platform ios
64
65
  */
65
- pressOpacity?: number;
66
+ pressOpacity?: number | undefined;
66
67
  /**
67
68
  * Style object for the label element.
68
69
  */
69
- labelStyle?: StyleProp<TextStyle>;
70
+ labelStyle?: StyleProp<TextStyle> | undefined;
70
71
  /**
71
72
  * Style object for the wrapper element.
72
73
  */
73
- style?: StyleProp<ViewStyle>;
74
+ style?: StyleProp<ViewStyle> | undefined;
74
75
  /**
75
76
  * Whether label font should scale to respect Text Size accessibility settings.
76
77
  */
77
- allowFontScaling?: boolean;
78
+ allowFontScaling?: boolean | undefined;
78
79
  /**
79
80
  * Accessibility label for drawer item.
80
81
  */
81
- accessibilityLabel?: string;
82
+ accessibilityLabel?: string | undefined;
82
83
  /**
83
84
  * ID to locate this drawer item in tests.
84
85
  */
85
- testID?: string;
86
+ testID?: string | undefined;
86
87
  };
87
88
  /**
88
89
  * A component used to show an action item with an icon and a label in a navigation drawer.
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EACD,MAAM,GACN,CAAC,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1E;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,UAAU,CAAC;KACnB,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;OAEG;IACH,qBAAqB,CAAC,EAAE,UAAU,CAAC;IACnC;;OAEG;IACH,uBAAuB,CAAC,EAAE,UAAU,CAAC;IACrC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,U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E/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG7E,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,GAmE7C,KAAK,CAAC,YAAY,CAC5C"}
1
+ {"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG7E,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,GAqE7C,KAAK,CAAC,YAAY,CAC5C"}
@@ -1,11 +1,16 @@
1
- import { type ColorValue, type ImageSourcePropType } from 'react-native';
1
+ import { type Icon } from '@react-navigation/elements';
2
+ import * as React from 'react';
3
+ import { type ColorValue } from 'react-native';
2
4
  type Props = {
3
- accessibilityLabel?: string;
4
- pressColor?: ColorValue;
5
- pressOpacity?: number;
6
- tintColor?: ColorValue;
7
- imageSource?: ImageSourcePropType;
5
+ icon?: Icon | ((props: {
6
+ tintColor: ColorValue | undefined;
7
+ }) => React.ReactNode) | undefined;
8
+ accessibilityLabel?: string | undefined;
9
+ pressColor?: ColorValue | undefined;
10
+ pressOpacity?: number | undefined;
11
+ tintColor?: ColorValue | undefined;
12
+ testID?: string | undefined;
8
13
  };
9
- export declare function DrawerToggleButton({ tintColor, accessibilityLabel, imageSource, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
14
+ export declare function DrawerToggleButton({ icon, tintColor, accessibilityLabel, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
10
15
  export {};
11
16
  //# sourceMappingURL=DrawerToggleButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,mBAAmB,EAEzB,MAAM,cAAc,CAAC;AAItB,KAAK,KAAK,GAAG;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,kBAA2C,EAC3C,WAA8B,EAC9B,GAAG,IAAI,EACR,EAAE,KAAK,2CAkBP"}
1
+ {"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAOrE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,UAAU,EAA+B,MAAM,cAAc,CAAC;AAI5E,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EACD,IAAI,GACJ,CAAC,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,UAAU,GAAG,SAAS,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,GACnE,SAAS,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,SAAS,EACT,kBAA2C,EAC3C,GAAG,IAAI,EACR,EAAE,KAAK,2CAuDP"}
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,UAAU,CAAC;AAQlB,KAAK,KAAK,GAAG,sBAAsB,GAAG;IACpC,aAAa,EAAE,YAAY,CAAC;IAC5B,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAsTF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAMxD"}
1
+ {"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,UAAU,CAAC;AAQlB,KAAK,KAAK,GAAG,sBAAsB,GAAG;IACpC,aAAa,EAAE,YAAY,CAAC;IAC5B,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAqTF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAMxD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@react-navigation/drawer",
3
3
  "description": "Integration for the drawer component from react-native-drawer-layout",
4
- "version": "8.0.0-alpha.3",
4
+ "version": "8.0.0-alpha.30",
5
5
  "keywords": [
6
6
  "react-native-component",
7
7
  "react-component",
@@ -46,36 +46,36 @@
46
46
  "clean": "del lib"
47
47
  },
48
48
  "dependencies": {
49
- "@react-navigation/elements": "^3.0.0-alpha.3",
50
- "color": "^4.2.3",
51
- "react-native-drawer-layout": "^5.0.0-alpha.0",
52
- "use-latest-callback": "^0.3.2"
49
+ "@react-navigation/elements": "^3.0.0-alpha.27",
50
+ "react-native-drawer-layout": "^5.0.0-alpha.10",
51
+ "use-latest-callback": "^0.3.3"
53
52
  },
54
53
  "devDependencies": {
55
- "@jest/globals": "^30.0.0",
56
- "@react-navigation/native": "^8.0.0-alpha.3",
57
- "@testing-library/react-native": "^13.2.1",
58
- "@types/react": "~19.1.10",
59
- "del-cli": "^6.0.0",
60
- "react": "19.1.0",
61
- "react-native": "0.81.4",
62
- "react-native-builder-bob": "^0.40.12",
63
- "react-native-gesture-handler": "~2.28.0",
64
- "react-native-reanimated": "4.1.3",
65
- "react-native-safe-area-context": "~5.6.0",
66
- "react-native-screens": "^4.20.0",
67
- "react-native-worklets": "0.6.1",
68
- "react-test-renderer": "19.1.0",
69
- "typescript": "^5.9.2"
54
+ "@jest/globals": "^30.3.0",
55
+ "@react-navigation/native": "^8.0.0-alpha.24",
56
+ "@testing-library/react-native": "^13.3.3",
57
+ "@types/react": "~19.2.2",
58
+ "del-cli": "^7.0.0",
59
+ "react": "19.2.0",
60
+ "react-native": "0.83.4",
61
+ "react-native-builder-bob": "^0.41.0",
62
+ "react-native-gesture-handler": "~2.30.0",
63
+ "react-native-reanimated": "~4.2.1",
64
+ "react-native-safe-area-context": "~5.6.2",
65
+ "react-native-screens": "^4.25.0",
66
+ "react-native-worklets": "0.7.2",
67
+ "react-test-renderer": "19.2.0",
68
+ "typescript": "^6.0.2"
70
69
  },
71
70
  "peerDependencies": {
72
- "@react-navigation/native": "^8.0.0-alpha.3",
73
- "react": ">= 19.0.0",
71
+ "@react-navigation/native": "^8.0.0-alpha.24",
72
+ "react": ">= 19.2.0",
74
73
  "react-native": "*",
75
74
  "react-native-gesture-handler": ">= 2.0.0",
76
75
  "react-native-reanimated": ">= 4.0.0",
77
76
  "react-native-safe-area-context": ">= 5.5.0",
78
- "react-native-screens": ">= 4.19.0"
77
+ "react-native-screens": ">= 4.25.0",
78
+ "react-native-worklets": ">= 0.4.0"
79
79
  },
80
80
  "react-native-builder-bob": {
81
81
  "source": "src",
@@ -95,5 +95,5 @@
95
95
  ]
96
96
  ]
97
97
  },
98
- "gitHead": "4579b7cfdf8b149ef04cfb585e2cb6b35ded52d7"
98
+ "gitHead": "55f169c7b6accb5d70167ec27e3a1529d9e2abde"
99
99
  }
package/src/index.tsx CHANGED
@@ -4,6 +4,7 @@
4
4
  export {
5
5
  createDrawerNavigator,
6
6
  createDrawerScreen,
7
+ type DrawerTypeBag,
7
8
  } from './navigators/createDrawerNavigator';
8
9
 
9
10
  /**
@@ -1,23 +1,18 @@
1
1
  import {
2
2
  createNavigatorFactory,
3
+ createScreenFactory,
3
4
  type DrawerActionHelpers,
4
5
  type DrawerNavigationState,
5
6
  DrawerRouter,
6
7
  type DrawerRouterOptions,
8
+ type NavigatorTypeBagBase,
7
9
  type ParamListBase,
8
- type StaticConfig,
9
- type StaticParamList,
10
- type StaticScreenConfig,
11
- type StaticScreenConfigLinking,
12
- type StaticScreenConfigScreen,
13
- type TypedNavigator,
14
10
  useNavigationBuilder,
15
11
  } from '@react-navigation/native';
16
12
 
17
13
  import type {
18
14
  DrawerNavigationEventMap,
19
15
  DrawerNavigationOptions,
20
- DrawerNavigationProp,
21
16
  DrawerNavigatorProps,
22
17
  } from '../types';
23
18
  import { DrawerView } from '../views/DrawerView';
@@ -68,41 +63,15 @@ function DrawerNavigator({
68
63
  );
69
64
  }
70
65
 
71
- type DrawerTypeBag<ParamList extends {}> = {
72
- ParamList: ParamList;
73
- State: DrawerNavigationState<ParamList>;
66
+ export interface DrawerTypeBag extends NavigatorTypeBagBase {
67
+ State: DrawerNavigationState<this['ParamList']>;
74
68
  ScreenOptions: DrawerNavigationOptions;
75
69
  EventMap: DrawerNavigationEventMap;
76
- NavigationList: {
77
- [RouteName in keyof ParamList]: DrawerNavigationProp<ParamList, RouteName>;
78
- };
70
+ ActionHelpers: DrawerActionHelpers<this['ParamList']>;
79
71
  Navigator: typeof DrawerNavigator;
80
- };
81
-
82
- export function createDrawerNavigator<
83
- const ParamList extends ParamListBase,
84
- >(): TypedNavigator<DrawerTypeBag<ParamList>, undefined>;
85
- export function createDrawerNavigator<
86
- const Config extends StaticConfig<DrawerTypeBag<ParamListBase>>,
87
- >(
88
- config: Config
89
- ): TypedNavigator<DrawerTypeBag<StaticParamList<{ config: Config }>>, Config>;
90
- export function createDrawerNavigator(config?: unknown) {
91
- return createNavigatorFactory(DrawerNavigator)(config);
92
72
  }
93
73
 
94
- export function createDrawerScreen<
95
- const Linking extends StaticScreenConfigLinking,
96
- const Screen extends StaticScreenConfigScreen,
97
- >(
98
- config: StaticScreenConfig<
99
- Linking,
100
- Screen,
101
- DrawerNavigationState<ParamListBase>,
102
- DrawerNavigationOptions,
103
- DrawerNavigationEventMap,
104
- DrawerNavigationProp<ParamListBase>
105
- >
106
- ) {
107
- return config;
108
- }
74
+ export const createDrawerNavigator =
75
+ createNavigatorFactory<DrawerTypeBag>(DrawerNavigator);
76
+
77
+ export const createDrawerScreen = createScreenFactory<DrawerTypeBag>();
package/src/types.tsx CHANGED
@@ -1,4 +1,5 @@
1
- import type { HeaderOptions } from '@react-navigation/elements';
1
+ import type { HeaderOptions, Icon } from '@react-navigation/elements';
2
+ import type { Screen } from '@react-navigation/elements/internal';
2
3
  import type {
3
4
  DefaultNavigatorOptions,
4
5
  Descriptor,
@@ -29,12 +30,6 @@ export type DrawerNavigationConfig = {
29
30
  * Defaults to `DrawerContent`.
30
31
  */
31
32
  drawerContent?: (props: DrawerContentComponentProps) => React.ReactNode;
32
- /**
33
- * Whether inactive screens should be detached from the view hierarchy to save memory.
34
- * Make sure to call `enableScreens` from `react-native-screens` to make it work.
35
- * Defaults to `true`.
36
- */
37
- detachInactiveScreens?: boolean;
38
33
  };
39
34
 
40
35
  export type DrawerNavigationOptions = HeaderOptions & {
@@ -70,13 +65,15 @@ export type DrawerNavigationOptions = HeaderOptions & {
70
65
  | ((props: { color: ColorValue; focused: boolean }) => React.ReactNode);
71
66
 
72
67
  /**
73
- * A function that given { focused: boolean, color: ColorValue } returns a React.Node to display an icon the drawer.
68
+ * Icon to display for the drawer item.
74
69
  */
75
- drawerIcon?: (props: {
76
- color: ColorValue;
77
- size: number;
78
- focused: boolean;
79
- }) => React.ReactNode;
70
+ drawerIcon?:
71
+ | Icon
72
+ | ((props: {
73
+ color: ColorValue;
74
+ size: number;
75
+ focused: boolean;
76
+ }) => Icon | React.ReactNode);
80
77
 
81
78
  /**
82
79
  * Color for the icon and label in the active item in the drawer.
@@ -108,6 +105,11 @@ export type DrawerNavigationOptions = HeaderOptions & {
108
105
  */
109
106
  drawerItemStyle?: StyleProp<ViewStyle>;
110
107
 
108
+ /**
109
+ * ID to locate this drawer item in tests.
110
+ */
111
+ drawerItemTestID?: string;
112
+
111
113
  /**
112
114
  * Style object to apply to the `Text` inside content section which renders a label.
113
115
  */
@@ -143,7 +145,7 @@ export type DrawerNavigationOptions = HeaderOptions & {
143
145
  *
144
146
  * Defaults to `slide` on iOS and `front` on other platforms.
145
147
  */
146
- drawerType?: 'front' | 'back' | 'slide' | 'permanent';
148
+ drawerType?: 'front' | 'back' | 'slide' | 'permanent' | undefined;
147
149
 
148
150
  /**
149
151
  * Whether the statusbar should be hidden when the drawer is pulled or opens,
@@ -170,7 +172,7 @@ export type DrawerNavigationOptions = HeaderOptions & {
170
172
  /**
171
173
  * Style object for the component wrapping the screen content.
172
174
  */
173
- sceneStyle?: StyleProp<ViewStyle>;
175
+ sceneStyle?: React.ComponentProps<typeof Screen>['style'];
174
176
 
175
177
  /**
176
178
  * Function to modify the pan gesture handler via RNGH properties API.
@@ -208,13 +210,17 @@ export type DrawerNavigationOptions = HeaderOptions & {
208
210
  popToTopOnBlur?: boolean;
209
211
 
210
212
  /**
211
- * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
212
- * Defaults to `true` when `enableFreeze()` is run at the top of the application.
213
- * Requires `react-native-screens` version >=3.16.0.
213
+ * What should happen when screens become inactive.
214
+ * - `pause`: Effects are cleaned up.
215
+ * - `none`: Screen renders normally
216
+ *
217
+ * Defaults to `pause`.
214
218
  *
215
- * Only supported on iOS and Android.
219
+ * If you set `lazy: false` or preload a screen,
220
+ * It won't be paused until after the first time it becomes focused.
221
+ * This makes sure that effects are run to initialize the screen.
216
222
  */
217
- freezeOnBlur?: boolean;
223
+ inactiveBehavior?: 'pause' | 'none';
218
224
  };
219
225
 
220
226
  export type DrawerContentComponentProps = {
@@ -8,7 +8,7 @@ import { DrawerStatusContext } from './DrawerStatusContext';
8
8
  * Returns 'open' if the drawer is open, 'closed' if the drawer is closed.
9
9
  */
10
10
  export function useDrawerStatus(): DrawerStatus {
11
- const drawerStatus = React.useContext(DrawerStatusContext);
11
+ const drawerStatus = React.use(DrawerStatusContext);
12
12
 
13
13
  if (drawerStatus === undefined) {
14
14
  throw new Error(
@@ -1,21 +1,31 @@
1
- import { useLocale } from '@react-navigation/native';
1
+ import { UNSTABLE_CornerInset, useLocale } from '@react-navigation/native';
2
2
  import * as React from 'react';
3
- import { ScrollView, type ScrollViewProps, StyleSheet } from 'react-native';
3
+ import {
4
+ Platform,
5
+ ScrollView,
6
+ type ScrollViewProps,
7
+ StyleSheet,
8
+ } from 'react-native';
4
9
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
10
 
6
11
  import { DrawerPositionContext } from '../utils/DrawerPositionContext';
7
12
 
8
13
  type Props = ScrollViewProps & {
9
14
  children: React.ReactNode;
15
+ ref?: React.Ref<ScrollView>;
10
16
  };
11
17
 
12
18
  const SPACING = 12;
13
19
 
14
- function DrawerContentScrollViewInner(
15
- { contentContainerStyle, style, children, ...rest }: Props,
16
- ref?: React.Ref<ScrollView>
17
- ) {
18
- const drawerPosition = React.useContext(DrawerPositionContext);
20
+ export function DrawerContentScrollView({
21
+ contentInsetAdjustmentBehavior = 'automatic',
22
+ contentContainerStyle,
23
+ style,
24
+ children,
25
+ ref,
26
+ ...rest
27
+ }: Props) {
28
+ const drawerPosition = React.use(DrawerPositionContext);
19
29
  const insets = useSafeAreaInsets();
20
30
  const { direction } = useLocale();
21
31
 
@@ -28,26 +38,32 @@ function DrawerContentScrollViewInner(
28
38
  <ScrollView
29
39
  {...rest}
30
40
  ref={ref}
41
+ contentInsetAdjustmentBehavior={contentInsetAdjustmentBehavior}
31
42
  contentContainerStyle={[
32
43
  {
33
- paddingTop: SPACING + insets.top,
34
- paddingBottom: SPACING + insets.bottom,
35
- paddingStart: SPACING + (!isRight ? insets.left : 0),
36
- paddingEnd: SPACING + (isRight ? insets.right : 0),
44
+ paddingTop:
45
+ SPACING + Platform.select({ ios: 0, default: insets.top }),
46
+ paddingBottom:
47
+ SPACING + Platform.select({ ios: 0, default: insets.bottom }),
48
+ paddingStart:
49
+ SPACING +
50
+ (!isRight ? Platform.select({ ios: 0, default: insets.left }) : 0),
51
+ paddingEnd:
52
+ SPACING +
53
+ (isRight ? Platform.select({ ios: 0, default: insets.right }) : 0),
37
54
  },
38
55
  contentContainerStyle,
39
56
  ]}
40
57
  style={[styles.container, style]}
41
58
  >
59
+ {Platform.OS === 'ios' && contentInsetAdjustmentBehavior !== 'never' && (
60
+ <UNSTABLE_CornerInset direction="vertical" edge="top" />
61
+ )}
42
62
  {children}
43
63
  </ScrollView>
44
64
  );
45
65
  }
46
66
 
47
- export const DrawerContentScrollView = React.forwardRef(
48
- DrawerContentScrollViewInner
49
- );
50
-
51
67
  const styles = StyleSheet.create({
52
68
  container: {
53
69
  flex: 1,