fix: typecheck in preact jsx.d.ts due to type change related to signals#955
fix: typecheck in preact jsx.d.ts due to type change related to signals#955robertmaier wants to merge 1 commit intopreactjs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 6116504 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
the delete type defines an optional boolean, which breaks typechecks in preacts jsx.d.ts file after adding Signals.
d4ea12e to
6116504
Compare
default from RoutableProps type|
Thanks for the PR! Did you check that the types work correct? I don't think they would, as |
|
@rschristian Thanks for haveing a first look. So you'd propose to do something like if I understand correctly? |
|
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 |
as reported in preactjs/preact#3934 the
defaultproperty inRoutablePropsbreaks typechecks in Preact'sjsx.d.tsfile.This is caused by the addition of Signals to Preact, after which the property is defined as
boolean | 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
defaultdefinition inpreact-routerhere. Which is why I would suggest to also do this inpreact-isoAn alternative solution would be to remove the type merging overall, but I don't have too much knowledge where the type is used.