Incorrect Type Display for actionData
#13289
Unanswered
nikolailehbrink
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using
actionDatain React Router 7, the TypeScript popover does not correctly display the expected type. Instead, it shows:However, when ensuring the value is not
nullorundefined, the correct types eventually appear, as seen in the screenshot.Interestingly, when using
useActionData, the types are displayed correctly from the start:This issue only seems to occur with
actionDatadirectly.Has anyone else encountered this issue? Could this be a limitation in TypeScript's inference or a React Router issue?
Beta Was this translation helpful? Give feedback.
All reactions