What’s New in React v16.7 – HAPITECHS

What’s New in React v16.7

Not that long ago, React v16.6 was released with some pretty awesome new features. Just in time for Christmas, the React team has released React v16.7 but not with the big feature we were all expecting to get our hands on over the holiday, Hooks.

Yes, even though Hooks were supposed to apart of this version, even showing up in the recent alphas, it was decided to omit the feature so that a fix for a nasty performance bug with React.lazy() could be released.

The reason behind doing a minor release without the addition of any new features is that the patches that were included in the release were considered non-trivial even though the forward facing behavior didn’t change.

This consideration for what constitutes minor releases even goes for the parts of React that are prefixed with unstable_.

Oh, and React team is going to try to avoid pinning unreleased features to specific versions of React. No more getting out hopes up only to be let down 😉

Even though we have to wait a bit longer for Hooks, that doesn’t mean we can’t take advantage of some of the improvements with this new version of React!

Fixes to React DOM

  • Performance improved for handling a ton of lazy loaded components with React.lazy()
  • Fix for a performance regression while in profiling mode
  • Fix for an issue with server-side rendering and context when using react-dom/server@16.6 with react@<16.6
  • Memory leak avoidance by clearing fields on unmount

Improvements and Fixes to Scheduler

Even though it’s still considered experimental, the React scheduler got some love:

  • Post to MessageChannel instead of window to avoid a ton of unnecessary calls to other message event handlers. Gracefully falls back to using window when MessagteChannel isn’t available
  • Reduction in overhead from serialization
  • Debugging methods added
  • Fix for a fallback to setTimeout which also may lead to the release of a new lib, jest-mock-scheduler in the future

Ready to get started with React v16.7?

Just go ahead and install it:

# Via npm $ npm install --save react@^16.7.0 react-dom@^16.7.0  # Via Yarn $ yarn add react@^16.7.0 react-dom@^16.7.0 
Leave a Reply

Your email address will not be published. Required fields are marked *