-
-
Notifications
You must be signed in to change notification settings - Fork 489
feat: Improve Typed Slots Support #2547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
: T extends { children?: infer S } ? { [K in keyof S]-?: S[K] extends ((obj: infer O) => any) | undefined ? O : any } | ||
: T extends { ${slots}?: infer S } ? S | ||
: T extends { children?: infer S } ? S | ||
: T extends { [K in keyof PickNotAny<JSX.ElementChildrenAttribute, {}>]?: infer S } ? S |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Shouldn't this be first? DefineComponent always has $slots but the default value is essentially
any
, so ElementChildrenAttribute will never be checked. ElementChildrenAttribute
is a property on the elements' props. In vue that's$props
, soJSX.ElementAttributesProperty
also needs to be used. The slots will be onT[keyof JSX.ElementAttributesProperty][keyof JSX.ElementChildrenAttribute]
This doesn't seem to solve my other problem either, slots from .vue files are still not accessible from tsx: // Comp.vue
<script setup lang="ts"></script>
<template>
<slot name="activator" :isActive="false" />
</template> // test.tsx
import Comp from './Comp.vue'
const el = (
<Comp>
{{ activator: props => props.isActive }}
</Comp>
) Same cause though, volar is defining |
Was this specific issue ever fixed? I'm still having the same problem. |
Typed Slot Children Support(delay)defineSlots Support(delay)