Tram-One / tram-one

🚋 Legacy View Framework For Vanilla Javascript
http://tram-one.io/
MIT License
36 stars 8 forks source link

Can't define types for TramOneComponent props #193

Closed JRJurman closed 2 years ago

JRJurman commented 2 years ago

Summary

When trying to define the types for a TramOneComponent, we get an error that the types are incompatible.

image

Type '({ groupInfo }: pageProps) => TramOneElement' is not assignable to type '(props: { [attribute: string]: any; }, children: Element) => TramOneElement'.
  Types of parameters '__0' and 'props' are incompatible.
    Property 'groupInfo' is missing in type '{ [attribute: string]: any; }' but required in type 'pageProps'.

I'm not exactly sure how we solve this - we still want to generically expect something that looks like a key-value pair, but this is clearly too restrictive.

JRJurman commented 2 years ago

This was fixed as part of #194