Skip to content

Commit a71a1da

Browse files
committed
Update more jsdocs for utils.ts
1 parent e777e7a commit a71a1da

File tree

6 files changed

+305
-82
lines changed

6 files changed

+305
-82
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"packages/react-router/lib/dom/ssr/server.tsx",
3636
"packages/react-router/lib/dom-export/hydrated-router.tsx",
3737
"packages/react-router/lib/dom/server.tsx",
38+
"packages/react-router/lib/router/utils.ts",
3839
"packages/react-router/lib/rsc/browser.tsx",
3940
"packages/react-router/lib/rsc/server.rsc.ts",
4041
"packages/react-router/lib/rsc/server.ssr.tsx",

packages/react-router/lib/components.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export interface MemoryRouterOpts {
162162
*/
163163
initialEntries?: InitialEntry[];
164164
/**
165-
* Index of {@link initialEntries} the application should initialize to
165+
* Index of `initialEntries` the application should initialize to
166166
*/
167167
initialIndex?: number;
168168
/**
@@ -572,7 +572,7 @@ export interface MemoryRouterProps {
572572
*/
573573
initialEntries?: InitialEntry[];
574574
/**
575-
* Index of {@link initialEntries} the application should initialize to
575+
* Index of `initialEntries` the application should initialize to
576576
*/
577577
initialIndex?: number;
578578
}
@@ -649,7 +649,7 @@ export interface NavigateProps {
649649
*/
650650
state?: any;
651651
/**
652-
* How to interpret relative routing in the {@link to} prop.
652+
* How to interpret relative routing in the `to` prop.
653653
* See {@link RelativeRoutingType}.
654654
*/
655655
relative?: RelativeRoutingType;
@@ -814,32 +814,32 @@ export interface PathRouteProps {
814814
children?: React.ReactNode;
815815
/**
816816
* The React element to render when this Route matches.
817-
* Mutually exclusive with {@link Component}.
817+
* Mutually exclusive with `Component`.
818818
*/
819819
element?: React.ReactNode | null;
820820
/**
821821
* The React element to render while this router is loading data.
822-
* Mutually exclusive with {@link HydrateFallback}.
822+
* Mutually exclusive with `HydrateFallback`.
823823
*/
824824
hydrateFallbackElement?: React.ReactNode | null;
825825
/**
826826
* The React element to render at this route if an error occurs.
827-
* Mutually exclusive with {@link ErrorBoundary}.
827+
* Mutually exclusive with `ErrorBoundary`.
828828
*/
829829
errorElement?: React.ReactNode | null;
830830
/**
831831
* The React Component to render when this route matches.
832-
* Mutually exclusive with {@link element}.
832+
* Mutually exclusive with `element`.
833833
*/
834834
Component?: React.ComponentType | null;
835835
/**
836836
* The React Component to render while this router is loading data.
837-
* Mutually exclusive with {@link hydrateFallbackElement}.
837+
* Mutually exclusive with `hydrateFallbackElement`.
838838
*/
839839
HydrateFallback?: React.ComponentType | null;
840840
/**
841841
* The React Component to render at this route if an error occurs.
842-
* Mutually exclusive with {@link errorElement}.
842+
* Mutually exclusive with `errorElement`.
843843
*/
844844
ErrorBoundary?: React.ComponentType | null;
845845
}
@@ -902,32 +902,32 @@ export interface IndexRouteProps {
902902
children?: undefined;
903903
/**
904904
* The React element to render when this Route matches.
905-
* Mutually exclusive with {@link Component}.
905+
* Mutually exclusive with `Component`.
906906
*/
907907
element?: React.ReactNode | null;
908908
/**
909909
* The React element to render while this router is loading data.
910-
* Mutually exclusive with {@link HydrateFallback}.
910+
* Mutually exclusive with `HydrateFallback`.
911911
*/
912912
hydrateFallbackElement?: React.ReactNode | null;
913913
/**
914914
* The React element to render at this route if an error occurs.
915-
* Mutually exclusive with {@link ErrorBoundary}.
915+
* Mutually exclusive with `ErrorBoundary`.
916916
*/
917917
errorElement?: React.ReactNode | null;
918918
/**
919919
* The React Component to render when this route matches.
920-
* Mutually exclusive with {@link element}.
920+
* Mutually exclusive with `element`.
921921
*/
922922
Component?: React.ComponentType | null;
923923
/**
924924
* The React Component to render while this router is loading data.
925-
* Mutually exclusive with {@link hydrateFallbackElement}.
925+
* Mutually exclusive with `hydrateFallbackElement`.
926926
*/
927927
HydrateFallback?: React.ComponentType | null;
928928
/**
929929
* The React Component to render at this route if an error occurs.
930-
* Mutually exclusive with {@link errorElement}.
930+
* Mutually exclusive with `errorElement`.
931931
*/
932932
ErrorBoundary?: React.ComponentType | null;
933933
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ function createHydratedRouter({
210210
}
211211

212212
/**
213-
* Props for the {@link HydratedRouter} component.
213+
* Props for the {@link dom.HydratedRouter} component.
214214
*
215215
* @category Types
216216
*/

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,15 @@ export interface DOMRouterOpts {
171171
* [`clientLoader`](../../start/framework/route-module#clientLoader)), you may
172172
* want to include `loaderData` for only some routes that were loaded/rendered
173173
* on the server. This allows you to hydrate _some_ of the routes (such as the
174-
* app layout/shell) while showing a {@link PathRouteProps.HydrateFallback | `HydrateFallback`}
174+
* app layout/shell) while showing a `HydrateFallback`
175175
* component and running the [`loader`](../../start/data/route-object#loader)s
176176
* for other routes during hydration.
177177
*
178178
* A route [`loader`](../../start/data/route-object#loader) will run during
179179
* hydration in two scenarios:
180180
*
181181
* 1. No hydration data is provided
182-
* In these cases the {@link PathRouteProps.HydrateFallback | `HydrateFallback`}
183-
* component will render on initial hydration
182+
* In these cases the `HydrateFallback` component will render on initial hydration
184183
* 2. The `loader.hydrate` property is set to `true`
185184
* This allows you to run the [`loader`](../../start/data/route-object#loader)
186185
* even if you did not render a fallback on initial hydration (i.e., to
@@ -242,9 +241,9 @@ export interface DOMRouterOpts {
242241
*
243242
* The `dataStrategy` function should return a key/value-object of
244243
* `routeId` -> {@link DataStrategyResult} and should include entries for any
245-
* routes where a handler was executed. A {@link DataStrategyResult} indicates
246-
* if the handler was successful or not based on the {@link DataStrategyResult.type}
247-
* field. If the returned {@link DataStrategyResult.result} is a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response),
244+
* routes where a handler was executed. A `DataStrategyResult` indicates
245+
* if the handler was successful or not based on the `DataStrategyResult.type`
246+
* field. If the returned `DataStrategyResult.result` is a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response),
248247
* React Router will unwrap it for you (via [`res.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json)
249248
* or [`res.text`](https://developer.mozilla.org/en-US/docs/Web/API/Response/text)).
250249
* If you need to do custom decoding of a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response)
@@ -438,7 +437,7 @@ export interface DOMRouterOpts {
438437
*
439438
* `patchRoutesOnNavigation` will be called anytime React Router is unable to
440439
* match a `path`. The arguments include the `path`, any partial
441-
* {@link RouteMatch | `matches`}, and a `patch` function you can call to patch
440+
* `matches`, and a `patch` function you can call to patch
442441
* new routes into the tree at a specific location. This method is executed
443442
* during the `loading` portion of the navigation for `GET` requests and during
444443
* the `submitting` portion of the navigation for non-`GET` requests.
@@ -541,7 +540,7 @@ export interface DOMRouterOpts {
541540
* **Co-locating route discovery with route definition**
542541
*
543542
* If you don't wish to perform your own pseudo-matching, you can leverage
544-
* the partial {@link RouteMatch | `matches`} array and the [`handle`](../../start/data/route-object#handle)
543+
* the partial `matches` array and the [`handle`](../../start/data/route-object#handle)
545544
* field on a route to keep the children definitions co-located:
546545
*
547546
* ```tsx

0 commit comments

Comments
 (0)