Skip to content

Commit bcf257d

Browse files
brookslybrandbrophdawg11
authored andcommitted
docs: improve Form component's discovery description (#14626)
* docs: improve Form component's discovery description * Add cross-links --------- Co-authored-by: Matt Brophy <matt@brophy.org>
1 parent 56b0454 commit bcf257d

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

packages/react-router/lib/dom/lib.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,16 +1039,16 @@ HistoryRouter.displayName = "unstable_HistoryRouter";
10391039
export interface LinkProps
10401040
extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
10411041
/**
1042-
* Defines the link discovery behavior
1042+
* Defines the link [lazy route discovery](../../explanation/lazy-route-discovery) behavior.
1043+
*
1044+
* - **render** — default, discover the route when the link renders
1045+
* - **none** — don't eagerly discover, only discover if the link is clicked
10431046
*
10441047
* ```tsx
10451048
* <Link /> // default ("render")
10461049
* <Link discover="render" />
10471050
* <Link discover="none" />
10481051
* ```
1049-
*
1050-
* - **render** — default, discover the route when the link renders
1051-
* - **none** — don't eagerly discover, only discover if the link is clicked
10521052
*/
10531053
discover?: DiscoverBehavior;
10541054

@@ -1687,16 +1687,16 @@ export interface FetcherFormProps extends SharedFormProps {}
16871687
*/
16881688
export interface FormProps extends SharedFormProps {
16891689
/**
1690-
* Defines the link discovery behavior. See {@link DiscoverBehavior}.
1690+
* Defines the form [lazy route discovery](../../explanation/lazy-route-discovery) behavior.
1691+
*
1692+
* - **render** — default, discover the route when the form renders
1693+
* - **none** — don't eagerly discover, only discover if the form is submitted
16911694
*
16921695
* ```tsx
1693-
* <Link /> // default ("render")
1694-
* <Link discover="render" />
1695-
* <Link discover="none" />
1696+
* <Form /> // default ("render")
1697+
* <Form discover="render" />
1698+
* <Form discover="none" />
16961699
* ```
1697-
*
1698-
* - **render** — default, discover the route when the link renders
1699-
* - **none** — don't eagerly discover, only discover if the link is clicked
17001700
*/
17011701
discover?: DiscoverBehavior;
17021702

packages/react-router/lib/dom/ssr/components.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export function useFrameworkContext(): FrameworkContextObject {
7676
// Public API
7777

7878
/**
79-
* Defines the discovery behavior of the link:
79+
* Defines the [lazy route discovery](../../explanation/lazy-route-discovery)
80+
* behavior of the link/form:
8081
*
8182
* - "render" - default, discover the route when the link renders
8283
* - "none" - don't eagerly discover, only discover if the link is clicked

0 commit comments

Comments
 (0)