Closed thecrypticace closed 1 week ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
headlessui-react | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 24, 2024 5:53pm |
headlessui-vue | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 24, 2024 5:53pm |
The existing
PropsForFeatures
type is meant to enable mutually exclusive props.A component may accept
static
andunmount
but may not accept both simultaneously. We encoded this in the typescript types but it's causing more problems than it solves. For example,Omit<ComponentProps, 'className'>
can't be spread back onto the component.So this basically replaced the three cases with the following:
{ static?: boolean }
{ unmount?: boolean }
{ static?: boolean, unmount?: boolean }
This makes TypeScript much happier about the types and should help typeschecking performance too.