Preact 7

Just a small bugfix release - DevTools was throwing an exception if components didn't inherit from Component. Preact supports components not inheriting from Component, so we've fixed the DevTools to match 👍

⚛️ Preact 7.2.0 is now available as a regular release!

npm install --save preact

Bugs Squashed

  • Fix IE issues from 7.1 and update test cases (huge thanks to @mkxml for the hard work on this 🙇)
  • Fix TextNode duplication in IE (#430, thanks also to @mkxml)
  • Fix unnececssary diff when swapping from dangerouslySetInnerHTML to children (thanks @harish2704)
  • Fix issue in 7.x with <select> sometimes not applying value prop (#446)
  • Don't stringify true children, instead skip them (#468, thanks @jxodwyer)
  • Fix issue where unmount could be skipped on a top-level component (#493, discovered by @insin)
  • (DevTools Integration) Fix multiple root element issue

New Features

  • Use a shared empty Array for props.children when there are no children. Fixes simple shallow equality-based shouldComponentUpdate for leaf nodes 🎉
  • Remove instanceof SVGElement check in favor of duck typing. Fixes JSDOM compatibility and improves diff performance (#423, thanks @nhunzaker)
  • Better TypeScript Definitions: Component lifecycle methods, setState callback, etc
  • 10x performance boost for initial rendering (#416)
  • Fix edge case when swapping component root (#414)
  • Fix diff reflow when removing leading element (#394)
  • Check existence of firstChild before checking if it is a Text node
  • Performance optimization for element/tree removal
  • Re-add short-circuit for PFC's (fixes compositional PFC triggering constant recycling)
  • Fixed TypeScript definition signature for linkState (#427)
  • Add a whole bunch of explanatory comments to the diff engine 🎉


This release fixes an issue when hydrating from a static server-rendered DOM that could cause Preact to do far more work than it should have been doing. If you're doing SSR, check out this release for a massive performance boost.


7.x is currently in beta. It should be an entirely safe upgrade for most.

The reason it's a new major version is because Preact now ignores externally created DOM elements when rendering, unless performing hydration from a server-render (ie - the diff is initiated from a render() against an element that was not created by the DOM renderer).