AlexxNB / tinro

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

Typescript problem #23

Closed meigo closed 4 years ago

meigo commented 4 years ago

When using in typescript enabled components

<script lang="ts">
  import { Route } from 'tinro';
  ...
</script>

<Route path="/">
  <h1>It is main page</h1>
</Route>
...

getting typescript complaints

JSX element class does not support attributes because it does not have a '$$prop_def' property.ts(2607)
'Route' cannot be used as a JSX component.
  Its instance type 'Route' is not a valid JSX element.
    Property '$$prop_def' is missing in type 'Route' but required in type 'ElementClass'.ts(2786)

Other than that this router is wonderful little gem, thank you.

AlexxNB commented 4 years ago

Do you use latest version? Same issue was fixedsome time ago https://github.com/AlexxNB/tinro/issues/17

meigo commented 4 years ago

Yes, tinro@0.3.3 on svelte@3.24.1

AlexxNB commented 4 years ago

Could you try version 3.0.0 - there are previous version of type declarations, I wrote myself. Later they been rewrites by community. Anyway I need help with manualy type definitions in *.d.ts file, because typescript is not my everyday tool.

AlexxNB commented 4 years ago

Ok, I'll try to resolve this soon, if nobody will help.

AlexxNB commented 4 years ago

Check the 0.3.5 version - should be fine now.

meigo commented 4 years ago

Looks great now, thank you.

AlexxNB commented 4 years ago

Cool!