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
interfaceObj{schema: z.ZodSchema;defaultValue: any/** should be the inferred type of `schema` */;}consta: Obj={schema: z.string(),defaultValue: 123,// should cause an error since it's no string}
Using z.infer<Obj["schema"]> unfortunately doesn't work (defaultValue becomes any) and I'm running out of ideas how to achieve this.
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
-
Hey,
quick question: how can I achieve this:
Using
z.infer<Obj["schema"]>
unfortunately doesn't work (defaultValue
becomesany
) and I'm running out of ideas how to achieve this.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions