You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When returning a Date or Temporal object from createServerFn it would be nice to specify a reviver to revive the Object instance on the client with useServerFn
import{createServerFn}from"@tanstack/react-start";exportconstfunction=createServerFn({method: "GET",// Optional reviver function just like `JSON.parse` second argumentreviver: (key,value)=>{if(key==="dateInstance"){returnnewDate(value)}}}).handler(async()=>{constserializable={dateInstance: newDate()};returnserializable;});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When returning a
Date
orTemporal
object fromcreateServerFn
it would be nice to specify a reviver to revive the Object instance on the client withuseServerFn
Beta Was this translation helpful? Give feedback.
All reactions