github preactjs/preact 10.25.0

one day ago

Features

Move per-element type interfaces into core and more strictly type IntrinsicElements (#4546, thanks @rschristian)

This adds per-element typings for every DOM-node type, this means that our types might become slightly stricter when you are using DOM attributes/properties where they are not allowed, an example of this might be <div src="x" />.

If you notice any issues when upgrading tell us about them, we can evaluate whether we have missed a case.

Recreate unkeyed functional components when they change position. (#4550, thanks @JoviDeCroock)

This is a long time bugfix, when we have elements that look like

return (
	{condition ? <Element /> : null}
	{condition ? null : <Element />
)

We would reuse the state of the first VNode to render the second one when the condition switches. When you are using key, this issue was not present.

Support { handleEvent() {} } object interface as a listener (#4538, thanks @lilnasy)

We've added support for attaching object/class event-handlers

let handler = {
	onclick,
	handleEvent() {
		this.onclick()
	}
}

<div onClick={handler} />

Fixes

Maintenance

Don't miss a new preact release

NewReleases is sending notifications on new releases.