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
foreign-sapphire•2mo 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 manuallystormy-goldOP•2mo ago
perfect. thank you!