T
TanStack14mo ago
like-gold

Is there an equivalent of React-Router's Action/Fetcher model?

I really like how React-Router lets you write an action that can take formdata or JSON from a Request, and call it from the client. It reduces a tonne of boilerplate. Is there anything similar to this for Tanstack Router? I guess Start will cover it to some extent with API/RPC routes, but I'm more interested in being able to do it on the client.
3 Replies
harsh-harlequin
harsh-harlequin14mo ago
i guess the closest equivalent in tanstack start will be server function https://tanstack.com/router/latest/docs/framework/react/start/server-functions
TanStack | High Quality Open-Source Software for Web Developers
Headless, type-safe, powerful utilities for complex workflows like Data Management, Data Visualization, Charts, Tables, and UI Components.
From An unknown user
From An unknown user
stormy-gold
stormy-gold13mo ago
are server functions stable enough to use in an applciation?
like-gold
like-gold13mo ago
start is still in alpha but we don't expect them to change much now that middlewares have landed

Did you find this page helpful?