Skip to content

[FEATURE REQUEST] It would be nice TypeScript support #10

@silvioprog

Description

@silvioprog

Hi.

Supposing this example:

<script>
class Order {
  document?: string;
}

let order = new Order();
</script>

<MaskInput
  bind:value={order.document}
  alwaysShowMask
  maskChar="_"
  mask="0000-000000-00000" />

it would be nice to add TypeScript solving problems like this:

(JSX attribute) value?: undefined
Type 'string | undefined' is not assignable to type 'undefined'.
  Type 'string' is not assignable to type 'undefined'.ts(2322)

Thank you!


EDIT:

To temporary solve the problem I just changed line 5 from export let value = undefined; to export let value = ""; and now the component works fine in a Sapper application with TypeScript support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions