T
TanStack5mo ago
foreign-sapphire

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.
1 Reply
correct-apricot
correct-apricot5mo ago
similar to https://discord.com/channels/719702312431386674/1359827746603401370 as of now, you can only handle async data in search params in beforeLoad and e.g. redirect

Did you find this page helpful?