github preactjs/preact 10.16.0

latest releases: 10.24.0, 10.23.2, 10.23.1...
14 months ago

Improved child diffing

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.

Defer setting refs

  • fix: setting ref to null after updating it with new element (#4054, thanks @JoviDeCroock)

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.

Fixes

Types

Don't miss a new preact release

NewReleases is sending notifications on new releases.