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
I have introduced single fetch and added the settings to tsconfig.json,
I added a setting to tsconfig.json, but when the return value of the conform submission.reply() used in the form validation was included
The type returned by useActionData is never.
tsconfig.json is as follows, with types added to the content created by create remix.
Therefore, the following error is displayed in typecheck.
$ pnpm typecheck
> conform-on-remix-single-fetch@ typecheck /Users/coji/progs/spike/conform/conform-on-remix-single-fetch
> tsc
app/routes/_index.tsx:19:29 - error TS2339: Property 'lastResult' does not exist on type 'never'.
19 lastResult: actionData?.lastResult,
~~~~~~~~~~
Found 1 error in app/routes/_index.tsx:19
The text was updated successfully, but these errors were encountered:
coji
changed the title
single fetch: returning conform.reply() with action results in type never.
Single fetch: returning conform.reply() with action results in type never.
May 4, 2024
coji
changed the title
Single fetch: returning conform.reply() with action results in type never.
Single fetch: returning submission.reply() with action results in type never.
May 4, 2024
Yeah I agree. The types for single fetch are restricting loaders/actions to returning types we know can be serialized by turbo-stream and won't throw an error at runtime. The unknown is problematic since we can't know what it will be and can't be sure it's something turbo-stream knows how to serialize.
I have introduced single fetch and added the settings to tsconfig.json,
I added a setting to tsconfig.json, but when the return value of the conform submission.reply() used in the form validation was included
The type returned by useActionData is never.
tsconfig.json is as follows, with types added to the content created by create remix.
Reproduction
https://stackblitz.com/~/github.com/coji/conform-on-remix-single-fetch
System Info
Used Package Manager
pnpm
Expected Behavior
The return type of useActionData is as follows.
Actual Behavior
The type is never.
Therefore, the following error is displayed in typecheck.
The text was updated successfully, but these errors were encountered: