Minor Changes
-
Fix an inconsistency with how
defaultProps
are applied (preactjs/preact-compat#47)A key in
props
with a value ofundefined
should be treated as a missing key, and the value fromdefaultProps
should be used in its place. -
Switch
setImmediate
backend fromMessageChannel
toPromise#then
(change diff)This is much faster!
However: This comes with the caveat of being unusable for animation. While this matches the use-case for
setImmediate()
within Preact (debouncing rendering), it means thatcomponentDidUpdate()
andsetState()
callbacks should not be used as a means of animation. ** This is only true when using the built-in debounce mechanism. Overriding to requestAnimationFrame is still a great way to do animations via these hooks.