⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM.
diffProps
function (#4200, thanks @andrewiggins)contentEditable
attribute values (#4163, thanks @shoonia)elementTiming
attribute/property (#4165, thanks @shoonia)exportparts
global attribute (#4164, thanks @shoonia)_nextDom
field on VNodes (#4166, thanks @andrewiggins)===
to ==
in a few places where not needed (#4157, thanks @rschristian)SetStateAction
& PropsWithoutRef
types to compat (#4132, thanks @rschristian)HTMLProps
to compat (#4117, thanks @rschristian)role
attribute when it's null
or undefined
(#4137, thanks @DAreRodz)isElement
function in preact/compat (#4041, thanks @cbbfcd)isFragment
function in preact/compat (#4042, thanks @cbbfcd)ComponentChild
as ReactNode
in the preact/compat types (#4077, thanks @rschristian)main
(#4069, thanks @marvinhagemeister)We have noticed a few scenario's where children would get unmounted and remounted eagerly due to some offset bugs in our child-diffing, with skew-based diffing we plan to address those. This is already part of v11 and has been introduced there by @andrewiggins. This has now been backported to Preact X so we can benefit from the consistency improvements here as well.
We used to set refs as part of the children, synchronously this caused several issues when a ref would go down a level, i.e. the following example
const App = () => {
return phase === 1 ? <div ref={x}><p>Foo</p></div> : <div><div ref={x}><p>Foo</p></div>
}
In this example when we go from phase 1 to phase 2 we would mount a new ref but only after we bubble back up diffing clean up the outer ref making the ref reset to null.
ForwardRefExoticComponent
and RefAttributes
types in compat (#3996, thanks @rschristian)<dialog>
's close & cancel events (#4017, thanks @rschristian)