-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
typesChanges to the typescript typesChanges to the typescript types
Description
Which project does this relate to?
Router
Describe the bug
Hi, I think the type is broken for the useServerFn.
I've reproduced and noticed that if I need to use the onSuccess callback I loose the types
Your Example Website or App
https://github.com/Christopher96u/ts-issue-demo
Steps to Reproduce the Bug or Issue
- Go to the index/home route
Expected behavior
I expect as user, to have the onSuccess types back or improve the docs if this is the right behaviour
Screenshots or Videos
If I comment out the onSuccess callback there is no TS issues

If I leave the onSuccess callback there is a TS issue

If we use the useServerFn hook at top level (not inside the useMutation hook, we get the types back

Platform
- Router / Start Version: [e.g. 1.121.0]
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Browser Version: [e.g. 91.1]
- Bundler: [e.g. vite]
- Bundler Version: [e.g. 7.0.0]
Additional context
No response
abdrhmniqbal
Metadata
Metadata
Assignees
Labels
typesChanges to the typescript typesChanges to the typescript types