#Async data for search params

1 messages · Page 1 of 1 (latest)

old sluice
#

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.

cunning patrol