Skip to content

Commit b49dd22

Browse files
committed
chore: update docs
1 parent d9beb18 commit b49dd22

4 files changed

Lines changed: 32 additions & 13 deletions

File tree

guides/GUIDE_FOR_LIBRARY_AUTHORS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@ Allows for customizing font size to be used for back button title on iOS.
502502

503503
Whether the back button title should be visible. Defaults to `true`.
504504

505+
When set to `false` it works as a "kill switch": it enforces `backButtonDisplayMode=minimal` and ignores `backButtonDisplayMode`, `backTitleFontSize`, `backTitleFontFamily`, `disableBackButtonMenu`, and `backTitle` works only for back button menu.
506+
505507
### `blurEffect` (iOS only)
506508

507509
Blur effect to be applied to the header. Works with `backgroundColor`'s alpha < 1.
@@ -520,7 +522,9 @@ Boolean indicating whether to show the menu on longPress of iOS >= 14 back butto
520522

521523
### `backButtonDisplayMode` (iOS only)
522524

523-
Enum value indicating display mode of **default** back button. It works on iOS >= 14, and is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` or `backTitle` is set. Otherwise, when the button is customized, under the hood we use iOS native `backButtonItem` which overrides `backButtonDisplayMode`. Read more [#2123](https://github.com/software-mansion/react-native-screens/pull/2123). Possible options:
525+
Enum value indicating display mode of back button. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu`, `backTitle` and `backTitleVisible=false` is set. When the button is customized, under the hood we use iOS native `backButtonItem` which overrides `backButtonDisplayMode`. Read more [#2123](https://github.com/software-mansion/react-native-screens/pull/2123). The `backTitleVisible` forces `backButtonDisplayMode: minimal` and omits other values. Read more [#2800](https://github.com/software-mansion/react-native-screens/pull/2800)
526+
527+
Possible options:
524528

525529
- `default` – show given back button previous controller title, system generic or just icon based on available space
526530
- `generic` – show given system generic or just icon based on available space

native-stack/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ Boolean indicating whether to show the menu on longPress of iOS >= 14 back butto
8282

8383
#### `backButtonDisplayMode` (iOS only)
8484

85-
Enum value indicating display mode of **default** back button. It works on iOS >= 14, and is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` or `backTitle` is set. Otherwise, when the button is customized, under the hood we use iOS native `backButtonItem` which overrides `backButtonDisplayMode`. Read more [#2123](https://github.com/software-mansion/react-native-screens/pull/2123). Possible options:
85+
Enum value indicating display mode of back button. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu`, `backTitle` and `backTitleVisible=false` is set. When the button is customized, under the hood we use iOS native `backButtonItem` which overrides `backButtonDisplayMode`. Read more [#2123](https://github.com/software-mansion/react-native-screens/pull/2123). The `backTitleVisible` forces `backButtonDisplayMode: minimal` and omits other values. Read more [#2800](https://github.com/software-mansion/react-native-screens/pull/2800)
86+
87+
Possible options:
8688

8789
- `default` – show given back button previous controller title, system generic or just icon based on available space
8890
- `generic` – show given system generic or just icon based on available space
@@ -128,7 +130,9 @@ Style object for header back title. Supported properties:
128130

129131
#### `headerBackTitleVisible` (iOS only)
130132

131-
Whether the back button title should be visible or not. Defaults to `true`.
133+
Whether the back button title should be visible. Defaults to `true`.
134+
135+
When set to `false` it works as a "kill switch": it enforces `backButtonDisplayMode=minimal` and ignores `backButtonDisplayMode`, `backTitleFontSize`, `backTitleFontFamily`, `disableBackButtonMenu`, and `backTitle` works only for back button menu.
132136

133137
#### `headerCenter`
134138

src/native-stack/types.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,12 @@ export type NativeStackNavigationOptions = {
140140
*/
141141
disableBackButtonMenu?: boolean;
142142
/**
143-
* How the back button behaves by default (when not customized). Available on iOS>=14, and is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` or `backTitle` is set.
144-
* The following values are currently supported (they correspond to https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc):
145-
* - "default" – show given back button previous controller title, system generic or just icon based on available space
146-
* - "generic" – show given system generic or just icon based on available space
147-
* - "minimal" – show just an icon
143+
* How the back button behaves. It is used only when none of: `headerBackTitleStyle`, `disableBackButtonMenu`, `headerBackTitle` and `headerBackTitleVisible=false` is set.
144+
*
145+
* - `default` – show given back button previous controller title, system generic or just icon based on available space
146+
* - `generic` – show given system generic or just icon based on available space
147+
* - `minimal` – show just an icon
148+
*
148149
* @platform ios
149150
*/
150151
backButtonDisplayMode?: ScreenStackHeaderConfigProps['backButtonDisplayMode'];
@@ -206,6 +207,10 @@ export type NativeStackNavigationOptions = {
206207
};
207208
/**
208209
* Whether the back button title should be visible or not. Defaults to `true`.
210+
*
211+
* When set to `false` it works as a "kill switch": it enforces `backButtonDisplayMode=minimal`, and ignores `backButtonDisplayMode`,
212+
* `headerBackTitleStyle`, `disableBackButtonMenu`. For `headerBackTitle` it works only in back button menu.
213+
*
209214
* Only supported on iOS.
210215
*
211216
* @platform ios

src/types.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,10 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
544544
backTitleFontSize?: number;
545545
/**
546546
* Whether the back button title should be visible or not. Defaults to `true`.
547+
*
548+
* When set to `false` it works as a "kill switch": it enforces `backButtonDisplayMode=minimal` and ignores `backButtonDisplayMode`, `backTitleFontSize`, `backTitleFontFamily`, `disableBackButtonMenu`.
549+
* For `backTitle` it works only in back button menu.
550+
*
547551
* @platform ios
548552
*/
549553
backTitleVisible?: boolean;
@@ -570,11 +574,13 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
570574
*/
571575
disableBackButtonMenu?: boolean;
572576
/**
573-
* How the back button behaves by default (when not customized). Available on iOS>=14, and is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` or `backTitle` is set.
574-
* The following values are currently supported (they correspond to https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc):
575-
* - "default" – show given back button previous controller title, system generic or just icon based on available space
576-
* - "generic" – show given system generic or just icon based on available space
577-
* - "minimal" – show just an icon
577+
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu`, `backTitle` and `backTitleVisible=false` is set.
578+
* To read more see [#2800](https://github.com/software-mansion/react-native-screens/pull/2800) and [#2800](https://github.com/software-mansion/react-native-screens/pull/2800).
579+
*
580+
* - `default` – show given back button previous controller title, system generic or just icon based on available space
581+
* - `generic` – show given system generic or just icon based on available space
582+
* - `minimal` – show just an icon
583+
*
578584
* @platform ios
579585
*/
580586
backButtonDisplayMode?: BackButtonDisplayMode;

0 commit comments

Comments
 (0)