Skip to content

types: NormalizedScopedSlot for scopedSlots on RenderContext? #9616

Closed
@romansp

Description

@romansp

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions