Open robertmaier opened 1 year ago
Latest commit: 611650415693772e9d7d77f1dd1e7bce8ffa244d
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Thanks for the PR!
Did you check that the types work correct? I don't think they would, as IntriniscAttributes
needs to have RouteableProps
else something like this wouldn't work: <Home default />
. I think we need to exclude the HTMLAttributes
's default
from IntrinsicAttributes
instead
@rschristian Thanks for haveing a first look. So you'd propose to do something like
type IntrinsicAttributes = Omit<preact.JSX.IntrinsicAttributes, 'default'>
if I understand correctly? I'll have a look if it solves our typecheck issue and let you know how it went.
I think so? I'm admittedly not a huge fan of TS, but I think that's what we'd need to do, or something along those lines anyways.
It's weird (to me, anyways) that this is an issue though, as default
shouldn't exist on components to cause conflicts. <Foo default />
shouldn't work (without these routers' types), so I'm not really sure I understand what the conflict is, if that makes sense.
as reported in https://github.com/preactjs/preact/issues/3934 the
default
property inRoutableProps
breaks typechecks in Preact'sjsx.d.ts
file. This is caused by the addition of Signals to Preact, after which the property is defined asboolean | undefined | SignalLike<boolean | undefined>
instead of a plain optional boolean.The type ends up in preact's types because of namespace declaration merging.
@marvinhagemeister suggested to remove the
default
definition inpreact-router
here. Which is why I would suggest to also do this inpreact-iso
An alternative solution would be to remove the type merging overall, but I don't have too much knowledge where the type is used.