pablo-abc / felte

An extensible form library for Svelte, Solid and React
https://felte.dev
MIT License
1.01k stars 43 forks source link

ValidationMessage should be a SvelteComponentTyped #299

Open gl-aagostino opened 3 months ago

gl-aagostino commented 3 months ago

Describe the bug

I started receiving this error upon using ValidationMessage

Argument of type 'typeof ValidationMessage' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'.
  Type 'typeof ValidationMessage' provides no match for the signature 'new (args: { target: any; props?: any; }): ATypedSvelteComponent'.

Possible causes:
- You use the instance type of a component where you should use the constructor type
- Type definitions are missing for this Svelte Component. If you are using Svelte 3.31+, use SvelteComponentTyped to add a definition:
  import type { SvelteComponentTyped } from "svelte";
  class ComponentName extends SvelteComponentTyped<{propertyName: string;}> {}ts(2345)

I think it can be fixed by changing this

export default class ValidationMessage extends SvelteComponent

to this

export default class ValidationMessage extends SvelteComponentTyped

Which package/s are you using?

@felte/reporter-svelte

Environment

To reproduce

No response

Small reproduction example

No response

Screenshots

No response

Additional context

No response