You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update `Route.MetaArgs` to reflect that `data` can be potentially `undefined`
6
+
7
+
This is primarily for cases where a route `loader` threw an error to it's own `ErrorBoundary`. but it also arises in the case of a 404 which renders the root `ErrorBoundary`/`meta` but the root loader did not run because not routes matched.
Copy file name to clipboardExpand all lines: packages/react-router/lib/types/route-module.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ type CreateMetaArgs<T extends RouteInfo> = {
61
61
/** {@link https://reactrouter.com/start/framework/routing#dynamic-segments Dynamic route params} for the current route. */
62
62
params: T["params"];
63
63
/** The return value for this route's server loader function */
64
-
data: T["loaderData"];
64
+
data: T["loaderData"]|undefined;
65
65
/** Thrown errors that trigger error boundaries will be passed to the meta function. This is useful for generating metadata for error pages. */
66
66
error?: unknown;
67
67
/** An array of the current {@link https://api.reactrouter.com/v7/interfaces/react_router.UIMatch.html route matches}, including parent route matches. */
0 commit comments