AlexxNB / tinro

Highly declarative, tiny, dependency free router for Svelte's web applications.
MIT License
669 stars 30 forks source link

Type definitions missing for Route component #117

Open gurumaxi opened 1 year ago

gurumaxi commented 1 year ago

I am using svelte in combination with Typescript. When importing and using the Route component, I get the following error and suggestion:

Argument of type 'typeof Route' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'.

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;}> {}

Is it possible to add this type definition for the route component?

bluszcz commented 3 days ago

Is there a way not to use svelte-spa-router at all with this bug? I am facing the same problem.