Skip to content

Commit 194788b

Browse files
committed
Fix single fetch types for synchronous loader/action functions
1 parent d3a5f38 commit 194788b

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/violet-trains-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@remix-run/react": patch
3+
---
4+
5+
[REMOVE] Fix return type when no promise is used

packages/remix-react/future/single-fetch.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ type DataFunctionReturnValue =
3636

3737
type LoaderFunction_SingleFetch = (
3838
args: LoaderFunctionArgs
39-
) => Promise<DataFunctionReturnValue>;
39+
) => Promise<DataFunctionReturnValue> | DataFunctionReturnValue;
4040
type ActionFunction_SingleFetch = (
4141
args: ActionFunctionArgs
42-
) => Promise<DataFunctionReturnValue>;
42+
) => Promise<DataFunctionReturnValue> | DataFunctionReturnValue;
4343

4444
// Backwards-compatible type for Remix v2 where json/defer still use the old types,
4545
// and only non-json/defer returns use the new types. This allows for incremental

0 commit comments

Comments
 (0)