Skip to content

TS 5.8 JSX.ElementChildrenAttribute breakΒ #61354

Closed
@morlay

Description

@morlay

πŸ”Ž Search Terms

5.8, return, type

πŸ•— Version & Regression Information

  • This changed between versions 5.7.3 and 5.8

⏯ Playground Link

No response

πŸ’» Code

I defined custom ElementChildrenAttribute, it work well before TS 5.8

declare global {
  namespace JSX {
    // infer children type
    export interface ElementChildrenAttribute {
      $default: {};
    }
  }
}

Once I upgrade to TS 5.8, JSX like below throw the errors.

const $el = <div>test</div>

πŸ™ Actual behavior

Type { children: Element[]; } is not assignable to type

πŸ™‚ Expected behavior

no errors

Additional information about the issue

full custom JSX declare
https://github.com/innoai-tech/vuekit/blob/main/nodepkg/vue-jsx-runtime/src/jsx-runtime.ts#L104-L153

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions