Skip to content

Commit bc2e27b

Browse files
committed
fix(v2_meta): hint data as being potentially undefined
Closes remix-run#6210
1 parent 8f695fd commit bc2e27b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

packages/remix-react/routeModules.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ export interface V2_MetaArgs<
117117
Loader extends LoaderFunction | unknown = unknown,
118118
MatchLoaders extends Record<string, unknown> = Record<string, unknown>
119119
> {
120-
data: Loader extends LoaderFunction ? SerializeFrom<Loader> : AppData;
120+
data:
121+
| (Loader extends LoaderFunction ? SerializeFrom<Loader> : AppData)
122+
| undefined;
121123
params: Params;
122124
location: Location;
123125
matches: V2_MetaMatches<MatchLoaders>;

packages/remix-server-runtime/routeModules.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export interface V2_ServerRuntimeMetaArgs<
200200
Loader extends LoaderFunction | unknown = unknown,
201201
MatchLoaders extends Record<string, unknown> = Record<string, unknown>
202202
> {
203-
data: Loader extends LoaderFunction ? SerializeFrom<Loader> : AppData;
203+
data:
204+
| (Loader extends LoaderFunction ? SerializeFrom<Loader> : AppData)
205+
| undefined;
204206
params: Params;
205207
location: Location;
206208
matches: V2_ServerRuntimeMetaMatches<MatchLoaders>;

0 commit comments

Comments
 (0)