Closed scamden closed 10 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-ts-form | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 4, 2023 0:49am |
@iway1 i'm inclined to merge as this fixes a host of issues, but let me know if you are uncomfortable
I noticed our unwrap types didn't work for .default() even though the runtime code did. I've also seen a bug where z.enum().array() doesn't match either (because we didn't unwrap the enum type of the array element).
The solution to all of this (and a few other possible differences in order) was to make the unwrap recursive. However, the type had a comment mentioning that previously that created a stack overflow.
Turns out this is possible (and seems fast) as long as we limit the depth to the max number of unwraps we allow. Similar to what we did with the type recursion in PropType (but much much simpler here)
cc @brettzallen (for the default problem) @matasar-watershed (cause the enum array problem)