developit / developit/htm

type of htm/preact and htm directly are different

Offen
#244 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
9k
Forks
181
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

https://github.com/developit/htm/blob/d62dcfdc721e47bc1923a2cb7a01ebd594ab0c25/src/integrations/preact/index.d.ts#L4

this returns VNode, while if you do `htm.bind(h)` the inferred return type is `VNode | VNode[]`

https://github.com/developit/htm/blob/d62dcfdc721e47bc1923a2cb7a01ebd594ab0c25/src/index.d.ts#L2-L4

Which one of the two types is correct? Should this be changed in the htm/preact type?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with src/integrations/preact/index.d.ts and src/index.d.ts at the referenced lines, then compare how the two declarations infer the tagged-template return type. Resolve which type matches the intended API and apply that choice consistently; done when the direct htm/preact type and htm.bind(h) type no longer disagree.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.