Advices for this use case?
Hi, any advice for improving these schemas? I'm pretty new to Arktype.
4 Replies
This is my schema so far
Things I'd like to improve:
- be able to define in other file my cmsSharedScope. And just pick the "properties" I want in others scopes. For example buttonVariant, cardVariant, etc
- Make my Schema smart enough to explicitly define max depth 2
- If the prop icon is present, then icon_style should be present too
Make depth 0|1|2 instead maybe
I don't think wrapper is useful because it's too simple
Why not just
: { data: 'navitem[]'
?
I don't remember if there is scope().scope()
but ik for sure there's scope().type()
I did it because all the cms api responses has that data attribute and I dont really need it, I just need it to validad the API response at service layer/level. then react-query will infer the type and I'll need the actual naveItem type somewhere depth on my component tree, but you're right. I'll try to remove it and see how it goes
If you don't care you may just
unknown
it