Skip to content

Commit

Permalink
Update types JSDocs to match README
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Sep 26, 2024
1 parent 0cff106 commit fd6dd01
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/components/src/navigator/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,24 @@ export type NavigatorProps = {
export type NavigatorScreenProps = {
/**
* The screen's path, matched against the current path stored in the navigator.
*
* `Navigator` assumes that screens are organized hierarchically according
* to their `path`, which should follow a URL-like scheme where each path
* segment starts with and is separated by the `/` character.
*
* `Navigator` will treat "back" navigations as going to the parent screen —
* it is therefore responsibility of the consumer of the component to create
* the correct screen hierarchy.
*
* For example:
* - `/` is the root of all paths. There should always be a screen with
* `path="/"`;
* - `/parent/child` is a child of `/parent`;
* - `/parent/child/grand-child` is a child of `/parent/child`;
* - `/parent/:param` is a child of `/parent` as well;
* - if the current screen has a `path="/parent/child/grand-child"`, when
* going "back" `Navigator` will try to recursively navigate the path
* hierarchy until a matching screen (or the root `/`) is found.
*/
path: string;
/**
Expand Down

0 comments on commit fd6dd01

Please sign in to comment.