useServerFn
Hi, is
useServerFn a hard requirement when using server function in react-query?
docs put it like this:
how would you do it if you use the queryOptions pattern like this?
what's the difference?2 Replies
rival-black•5mo ago
is useServerFn a hard requirement
no, see https://tanstack.com/start/latest/docs/framework/react/server-functions#calling-server-functions-from-hooks-and-components
useServerFn simply handles redirects and notFounds thrown by the server fn. if you're not using that hook you can just catch/handle them manuallyeastern-cyanOP•5mo ago
perfect. thank you!