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
Use-case:
I have a generic React (data page) component that uses react-hook-form as part of its functionality and I want to seed the RHF resolver with that schema.
This generic component also exports a base schema on which calling components can build their schema.
I.e. I have a specific view page that extends the base schema and customizes only certain fields and then calls the generic data component with a bunch of props including that (customized) schema.
Is there an (easy) way to verify whether a customized schema correctly extends the base schema?
(Obviously, I can verify if all the keys are there in the shape. The only difference is that the base shape has z.record(z.string(), z.boolean()) and the customized versions have strongly typed records.
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
-
As title.
Use-case:
I have a generic React (data page) component that uses react-hook-form as part of its functionality and I want to seed the RHF resolver with that schema.
This generic component also exports a base schema on which calling components can build their schema.
I.e. I have a specific view page that extends the base schema and customizes only certain fields and then calls the generic data component with a bunch of props including that (customized) schema.
Is there an (easy) way to verify whether a customized schema correctly extends the base schema?
(Obviously, I can verify if all the keys are there in the shape. The only difference is that the base shape has
z.record(z.string(), z.boolean())
and the customized versions have strongly typed records.Beta Was this translation helpful? Give feedback.
All reactions