Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

m.route.Link type issue #40

@erikvullings

Description

@erikvullings

When writing the following code

return m(isExternalLink() ? 'a' : m.route.Link, { href: '' }, 'Link text')

The following exception is raised:

const title: string | m.Vnode<any, any>
Argument of type 'Component<RouteLinkAttrs, {}> | "a"' is not assignable to parameter of type 'ComponentTypes<RouteLinkAttrs, {}>'.
  Type '"a"' is not assignable to type 'ComponentTypes<RouteLinkAttrs, {}>'.ts(2345)

while this is perfectly legal (and working) JS code.

See also gitter for the original discussion of the behaviour.

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