TanStackT
TanStackโ€ข10mo agoโ€ข
2 replies
moderate-tomato

Async data for search params

We have a from date as a search param but this from date we fetch from the database. What should my zod default be for this? Should I even be introducing async code at this point or be handling it later down in the component say (default is "" and if component sees "" then fetch info from database?) any suggestions would be great thanks in advance ๐Ÿ™
TDLR: How can we add async values in default value in zod schemas when creating search params.
Was this page helpful?