Reading default values from a schema #3843
Unanswered
ravinggenius
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building a search form, and the schema for it is defined as the following:
This is further processed with
.transform()
step, but that's not relevant to my question. I'd really like access to the default values and the catch fallback values too. I tried the following, but it doesn't work:I would expect something like
.defaultValue()
(and.catchFallback()
) to be available. I asked ChatGPT. It suggestedRAW_SEACH_QUERY.shape.q._def.defaultValue()
, but.defaultValue()
isn't defined. Worse I assume_def
isn't part of the public API, so using it is likely not supported.Is there a (supported) way to access the default values that I'm just missing?
Beta Was this translation helpful? Give feedback.
All reactions