Skip to content
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

types: NormalizedScopedSlot for scopedSlots on RenderContext? #9616

Closed
romansp opened this issue Mar 4, 2019 · 0 comments · Fixed by #9624
Closed

types: NormalizedScopedSlot for scopedSlots on RenderContext? #9616

romansp opened this issue Mar 4, 2019 · 0 comments · Fixed by #9624

Comments

@romansp
Copy link

romansp commented Mar 4, 2019

Version

2.6.8

Reproduction link

https://github.com/romansp/functional-scoped-slots-type

Steps to reproduce

yarn install
yarn serve

What is expected?

yarn serve without errors

What is actually happening?

Type error:

Argument of type '{ functional: boolean; render(h: CreateElement, ctx: RenderContext<Record<never, any>>): string | true | VNode | ScopedSlotReturnArray; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<string, any>>'.
  Object literal may only specify known properties, and 'functional' does not exist in type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>
, Record<string, any>>'.
    15 | 
    16 | export default Vue.extend({
  > 17 |   functional: true,
       |   ^
    18 |   render(h, ctx) {
    19 |     const children = ctx.scopedSlots.default && ctx.scopedSlots.default({});
    20 |     return children || h();
Version: typescript 3.3.3333

PR #9563 introduced NormalizedScopedSlot type, but RenderContext type for functional components still uses scopedSlots: { [key: string]: ScopedSlot };. Is it expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants