* This is the child screen.
*
- * Go back
+ * Go back (to parent)
*
*
*
diff --git a/packages/components/src/navigator/navigator-back-button/hook.ts b/packages/components/src/navigator/navigator-back-button/hook.ts
index edf55be0f15f5b..d4447b5f40ad46 100644
--- a/packages/components/src/navigator/navigator-back-button/hook.ts
+++ b/packages/components/src/navigator/navigator-back-button/hook.ts
@@ -10,31 +10,27 @@ import type { WordPressComponentProps } from '../../context';
import { useContextSystem } from '../../context';
import Button from '../../button';
import useNavigator from '../use-navigator';
-import type { NavigatorBackButtonHookProps } from '../types';
+import type { NavigatorBackButtonProps } from '../types';
export function useNavigatorBackButton(
- props: WordPressComponentProps< NavigatorBackButtonHookProps, 'button' >
+ props: WordPressComponentProps< NavigatorBackButtonProps, 'button' >
) {
const {
onClick,
as = Button,
- goToParent: goToParentProp = false,
+
...otherProps
} = useContextSystem( props, 'NavigatorBackButton' );
- const { goBack, goToParent } = useNavigator();
+ const { goBack } = useNavigator();
const handleClick: React.MouseEventHandler< HTMLButtonElement > =
useCallback(
( e ) => {
e.preventDefault();
- if ( goToParentProp ) {
- goToParent();
- } else {
- goBack();
- }
+ goBack();
onClick?.( e );
},
- [ goToParentProp, goToParent, goBack, onClick ]
+ [ goBack, onClick ]
);
return {
diff --git a/packages/components/src/navigator/navigator-provider/README.md b/packages/components/src/navigator/navigator-provider/README.md
index 8be27a65101843..13745fae68a15d 100644
--- a/packages/components/src/navigator/navigator-provider/README.md
+++ b/packages/components/src/navigator/navigator-provider/README.md
@@ -10,38 +10,42 @@ The `NavigatorProvider` component allows rendering nested views/panels/menus (vi
```jsx
import {
- __experimentalNavigatorProvider as NavigatorProvider,
- __experimentalNavigatorScreen as NavigatorScreen,
- __experimentalNavigatorButton as NavigatorButton,
- __experimentalNavigatorToParentButton as NavigatorToParentButton,
+ __experimentalNavigatorProvider as NavigatorProvider,
+ __experimentalNavigatorScreen as NavigatorScreen,
+ __experimentalNavigatorButton as NavigatorButton,
+ __experimentalNavigatorBackButton as NavigatorBackButton,
} from '@wordpress/components';
const MyNavigation = () => (
-