React logo

Technology review – React 16.10

Minor upgrade of React has come with version 16.10. Let us see what they did comparing to the previous upgrade.

Tl; dr;

React 16.10 comes with a bunch of bug fixes with no new feature added in.

Everything is backward compatible so you can upgrade your code base to React 16.10 with ease.

Bug fixes

React DOM

  • Fix edge case where a hook update wasn’t being memoized.
  • Fix heuristic for determining when to hydrate, so we don’t incorrectly hydrate during an update.
  • Clear additional fiber fields during unmount to save memory.
  • Fix bug with required text fields in Firefox.
  • Prefer Object.is instead of inline polyfill, when available.
  • Fix bug when mixing Suspense and error handling.

Most of these bug fixes are very specific, personally I haven’t come across any of these issues. But it is nice to see them fixed. One thing to notice is that there are a lot more issues currently open in the library issue board, and we will have more shipped in the future versions.

Scheduler (Experimental)

  • Improve queue performance by switching its internal data structure to a min binary heap.
  • Use postMessage loop with short intervals instead of attempting to align to frame boundaries with requestAnimationFrame.

The Scheduler is what React uses to optimize the performance of re-rendering the DOM. React team has spent a lot of time optimizing the internal feature to give us a nice performance that we need.

useSubscription

  • Avoid tearing issue when a mutation happens and the previous update is still in progress.

People have been using hooks for quite a while now, and they are useful in many circumstances. We would like to have a stable feature that we can depend on, and fixing bugs is getting us there.

Summary

Well this is a small blog post, but the impact of these bug fixes in React 16.10 are huge for the community. It proves that Facebook is still active in React development and it will not go away any time soon.

By Tuan Nguyen

One thought to “Technology review – React 16.10”

Leave a Reply

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