{"componentChunkName":"component---src-templates-blog-js","path":"/blog/2018/05/23/react-v-16-4.html","result":{"data":{"markdownRemark":{"html":"<p>The latest minor release adds support for an oft-requested feature: pointer events!</p>\n<p>It also includes a bugfix for <code class=\"gatsby-code-text\">getDerivedStateFromProps</code>. Check out the full <a href=\"#changelog\">changelog</a> below.</p>\n<h2 id=\"pointer-events\"><a href=\"#pointer-events\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Pointer Events </h2>\n<p>The following event types are now available in React DOM:</p>\n<ul>\n<li><code class=\"gatsby-code-text\">onPointerDown</code></li>\n<li><code class=\"gatsby-code-text\">onPointerMove</code></li>\n<li><code class=\"gatsby-code-text\">onPointerUp</code></li>\n<li><code class=\"gatsby-code-text\">onPointerCancel</code></li>\n<li><code class=\"gatsby-code-text\">onGotPointerCapture</code></li>\n<li><code class=\"gatsby-code-text\">onLostPointerCapture</code></li>\n<li><code class=\"gatsby-code-text\">onPointerEnter</code></li>\n<li><code class=\"gatsby-code-text\">onPointerLeave</code></li>\n<li><code class=\"gatsby-code-text\">onPointerOver</code></li>\n<li><code class=\"gatsby-code-text\">onPointerOut</code></li>\n</ul>\n<p>Please note that these events will only work in browsers that support the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Pointer Events</a> specification. (At the time of this writing, this includes the latest versions of Chrome, Firefox, Edge, and Internet Explorer.) If your application depends on pointer events, we recommend using a third-party pointer events polyfill. We have opted not to include such a polyfill in React DOM, to avoid an increase in bundle size.</p>\n<p><a href=\"https://codesandbox.io/api/v1/sandboxes/define?parameters=N4IgZglgNgpgziAXKADgQwMYGs0HMYB0AVnAPYB2SoGFALjObVSACYwoNvkYTxUC-AGhABbNBEqIQARgBsAWgAs8gE4xYaODHkAjKKVzyUpOLQD0xifRXyYANwa04tgB5oRKWMQT8hICWwuBAAWtCJQzDSMjkggADwsEHYABBAsALwAOiAqpKS02QB8cWaJdoUgfnJKquowmtp6BkYm5pbRNvaOzjBuHl4kkXQxUhAepCq0yQBK9RhTYLkiyQDkapi0KwDcmeRjxpMzc7QAIgDyALLJi6TLa8fyLLfbu7tRpskAwgCS058AMgBRAD6AGVvgAtQHJdLJAAcAFYduQ3lBNHBkicVHgAEKkFzJXr0cgsDGzDYET63YzkRzJYC7ZLJUxoegw-mMpnJYKaT5oFC0ACuakQ1zQUC0gk5TJ4KgwsH-MDAtFFcIADFLyFzkrL5TAACqkFCqjWc_jIpkQOBYvC4CS4dlgcVaC3JFBqOwQUiCuCK5XstWu932L0-w0oAPIzkUE6kADuWthXUYMMKHK1XNowStBCtNtwdvIDthtBUgpgrqZydoBFoaBU-BrWloAAVSFYYCo-QLhTAABTVgjtazfFgASijGaZZjMyQA6jBmbQJous4uJBBaBBxTq8ipEuRWfBksvkjpF2g9KvSDrxRhBWi2WudTyi_BpckZ8lH53khQCB-WY5kS2LzG2cCbl65AnOodYDg4jATmak5MhQFykA47LVqm6bahAYDJH2ACEQFwLm1rYgW9pjrh2rJGoQoqOQlbJPwH7vFMwCwMqggnka_DsqRBAgRs4GQTGsFoPBjhISiU4ntmZHNqCdb0H2fbALqCpKrQvFaQa_E0ekaYaR-MoQHK2nKqK-l-lMADU346ZqdE6hZerhjZ7mwOGySOcuKAuVy_BjrJTLmq8GYUAAqhGSYIVMxmEUJeaUYWxZihKMBhX-5AAOL5N2jGLvFdJJUJymqf2wA8nARW9qKpbliFroUP8rT1WoWEJamgGKQQlVHhptWdTAopOllLWRVWLilqJJjidBkndWVaYMvJHFOf6pWMEOeAwAAGixm0BStu3oPgACax0UB8bBQHW7Lra53EqltUzyApObBp63q-s5Zl8caQPJJ9Qk_aGcDhkF4UseDHqQ3Z7KvXD_UQ39vklkaLEMcKWr3XWroRXJTJqCSnZ9jRz1cptNW8vyxV6d5MB2UzlkGSgAklv1LL0ChNO3VMOj4ipACesBPYDwv7p2oorNIKAEmQUBpMkADELAAJxa1rKww1yYgNhIcvSGqivJGqyQAExmy4euAyIEgABIwBAuChKKihqqa8lMnGaRZib3sAKT277boLVuFBy2oj5JDAYfasT7GC257NixLsLU9q_ssIHXy_ACILglC-tMsErvu29Px_ECYKQoCZdnhMbAqNMaCJD6oo10X9dQp-1tN8YEFR-QcuXsrgr0IndGvV57Os4DAXzx5RpNzomBYLguSCiSVL6CooojQzvbJAA_KsejlisyRy9vMAMDP2rLoKGDBAAgvMUFy-QFAJ_ryd5K4yYoRQGCQkhLnFjAdIwBhYuAzjAfghRAZMnAXYFBXJTBQJgfpBBbFw7agoG2DsKhYwJhgUJGM8ZyD4NcoQ8gxCOjoQcBQ_qaEMKIIwahBh7YOixVYTmGKnMuG5UYdYPk3B1ACLIkI2hdDuEFVbLw8RJ81DSIIBQRRo05HyLaq0MRnZRrqL0aYbRGCzDIPDiUMoljtQ5Xwfg3Y5J5jnAuAQMmrc-ycjiPmPEBILFBSePeEQjgCCNkBLAEJjAcSi1HH2NYeRNhjl2LJSovggA\" target=\"_blank\" rel=\"noreferrer\">Check out this example on CodeSandbox.</a></p>\n<p>Huge thanks to <a href=\"https://github.com/philipp-spiess\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Philipp Spiess</a> for contributing this change!</p>\n<h2 id=\"bugfix-for-getderivedstatefromprops\"><a href=\"#bugfix-for-getderivedstatefromprops\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Bugfix for <code class=\"gatsby-code-text\">getDerivedStateFromProps</code> </h2>\n<p><code class=\"gatsby-code-text\">getDerivedStateFromProps</code> is now called every time a component is rendered, regardless of the cause of the update. Previously, it was only called if the component was re-rendered by its parent, and would not fire as the result of a local <code class=\"gatsby-code-text\">setState</code>. This was an oversight in the initial implementation that has now been corrected. The previous behavior was more similar to <code class=\"gatsby-code-text\">componentWillReceiveProps</code>, but the improved behavior ensures compatibility with React’s upcoming asynchronous rendering mode.</p>\n<p><strong>This bug fix will not affect most apps</strong>, but it may cause issues with a small fraction of components. The rare cases where it does matter fall into one of two categories:</p>\n<h3 id=\"1-avoid-side-effects-in-getderivedstatefromprops\"><a href=\"#1-avoid-side-effects-in-getderivedstatefromprops\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>1. Avoid Side Effects in <code class=\"gatsby-code-text\">getDerivedStateFromProps</code> </h3>\n<p>Like the render method, <code class=\"gatsby-code-text\">getDerivedStateFromProps</code> should be a pure function of props and state. Side effects in <code class=\"gatsby-code-text\">getDerivedStateFromProps</code> were never supported, but since it now fires more often than it used to, the recent change may expose previously undiscovered bugs.</p>\n<p>Side effectful code should be moved to other methods: for example, Flux dispatches typically belong inside the originating event handler, and manual DOM mutations belong inside componentDidMount or componentDidUpdate. You can read more about this in our recent post about <a href=\"/blog/2018/03/27/update-on-async-rendering.html\">preparing for asynchronous rendering</a>.</p>\n<h3 id=\"2-compare-incoming-props-to-previous-props-when-computing-controlled-values\"><a href=\"#2-compare-incoming-props-to-previous-props-when-computing-controlled-values\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>2. Compare Incoming Props to Previous Props When Computing Controlled Values </h3>\n<p>The following code assumes <code class=\"gatsby-code-text\">getDerivedStateFromProps</code> only fires on prop changes:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsx\"><pre class=\"gatsby-code-jsx\"><code class=\"gatsby-code-jsx\"><span class=\"token keyword\">static</span> <span class=\"token function\">getDerivedStateFromProps</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">props<span class=\"token punctuation\">,</span> state</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token keyword\">if</span> <span class=\"token punctuation\">(</span>props<span class=\"token punctuation\">.</span>value <span class=\"token operator\">!==</span> state<span class=\"token punctuation\">.</span>controlledValue<span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">return</span> <span class=\"token punctuation\">{</span>\n      <span class=\"token comment\">// Since this method fires on both props and state changes, local updates</span>\n      <span class=\"token comment\">// to the controlled value will be ignored, because the props version</span>\n      <span class=\"token comment\">// always overrides it. Oops!</span>\n      controlledValue<span class=\"token operator\">:</span> props<span class=\"token punctuation\">.</span>value<span class=\"token punctuation\">,</span>\n    <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n  <span class=\"token punctuation\">}</span>\n  <span class=\"token keyword\">return</span> <span class=\"token keyword\">null</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>One possible way to fix this is to compare the incoming value to the previous value by storing the previous props in state:</p>\n<div class=\"gatsby-highlight\" data-language=\"jsx\"><pre class=\"gatsby-code-jsx\"><code class=\"gatsby-code-jsx\"><span class=\"token keyword\">static</span> <span class=\"token function\">getDerivedStateFromProps</span><span class=\"token punctuation\">(</span><span class=\"token parameter\">props<span class=\"token punctuation\">,</span> state</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n  <span class=\"token keyword\">const</span> prevProps <span class=\"token operator\">=</span> state<span class=\"token punctuation\">.</span>prevProps <span class=\"token operator\">||</span> <span class=\"token punctuation\">{</span><span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n  <span class=\"token comment\">// Compare the incoming prop to previous prop</span>\n  <span class=\"token keyword\">const</span> controlledValue <span class=\"token operator\">=</span>\n    prevProps<span class=\"token punctuation\">.</span>value <span class=\"token operator\">!==</span> props<span class=\"token punctuation\">.</span>value\n      <span class=\"token operator\">?</span> props<span class=\"token punctuation\">.</span>value\n      <span class=\"token operator\">:</span> state<span class=\"token punctuation\">.</span>controlledValue<span class=\"token punctuation\">;</span>\n  <span class=\"token keyword\">return</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token comment\">// Store the previous props in state</span>\n    prevProps<span class=\"token operator\">:</span> props<span class=\"token punctuation\">,</span>\n    controlledValue<span class=\"token punctuation\">,</span>\n  <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n<p>However, <strong>code that “mirrors” props in state usually contains bugs</strong>, whether you use the newer <code class=\"gatsby-code-text\">getDerivedStateFromProps</code> or the legacy <code class=\"gatsby-code-text\">componentWillReceiveProps</code>. We published a follow-up blog post that explains these problems in more detail, and suggests <a href=\"/blog/2018/06/07/you-probably-dont-need-derived-state.html\">simpler solutions that don’t involve <code class=\"gatsby-code-text\">getDerivedStateFromProps()</code></a>.</p>\n<h2 id=\"installation\"><a href=\"#installation\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Installation </h2>\n<p>React v16.4.0 is available on the npm registry.</p>\n<p>To install React 16 with Yarn, run:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"gatsby-code-bash\"><code class=\"gatsby-code-bash\"><span class=\"token function\">yarn</span> <span class=\"token function\">add</span> react@^16.4.0 react-dom@^16.4.0</code></pre></div>\n<p>To install React 16 with npm, run:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"gatsby-code-bash\"><code class=\"gatsby-code-bash\"><span class=\"token function\">npm</span> <span class=\"token function\">install</span> --save react@^16.4.0 react-dom@^16.4.0</code></pre></div>\n<p>We also provide UMD builds of React via a CDN:</p>\n<div class=\"gatsby-highlight\" data-language=\"html\"><pre class=\"gatsby-code-html\"><code class=\"gatsby-code-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>script</span> <span class=\"token attr-name\">crossorigin</span> <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>https://unpkg.com/react@16/umd/react.production.min.js<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token script\"></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>script</span><span class=\"token punctuation\">></span></span>\n<span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;</span>script</span> <span class=\"token attr-name\">crossorigin</span> <span class=\"token attr-name\">src</span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=</span><span class=\"token punctuation\">\"</span>https://unpkg.com/react-dom@16/umd/react-dom.production.min.js<span class=\"token punctuation\">\"</span></span><span class=\"token punctuation\">></span></span><span class=\"token script\"></span><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;/</span>script</span><span class=\"token punctuation\">></span></span></code></pre></div>\n<p>Refer to the documentation for <a href=\"/docs/installation.html\">detailed installation instructions</a>.</p>\n<h2 id=\"changelog\"><a href=\"#changelog\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Changelog </h2>\n<h3 id=\"react\"><a href=\"#react\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React </h3>\n<ul>\n<li>Add a new <a href=\"https://github.com/reactjs/rfcs/pull/51\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">experimental</a> <code class=\"gatsby-code-text\">React.unstable_Profiler</code> component for measuring performance. (<a href=\"https://github.com/bvaughn\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@bvaughn</a> in <a href=\"https://github.com/facebook/react/pull/12745\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12745</a>)</li>\n</ul>\n<h3 id=\"react-dom\"><a href=\"#react-dom\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React DOM </h3>\n<ul>\n<li>Add support for the Pointer Events specification. (<a href=\"https://github.com/philipp-spiess\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@philipp-spiess</a> in <a href=\"https://github.com/facebook/react/pull/12507\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12507</a>)</li>\n<li>Properly call <code class=\"gatsby-code-text\">getDerivedStateFromProps()</code> regardless of the reason for re-rendering. (<a href=\"https://github.com/acdlite\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@acdlite</a> in <a href=\"https://github.com/facebook/react/pull/12600\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12600</a> and <a href=\"https://github.com/facebook/react/pull/12802\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12802</a>)</li>\n<li>Fix a bug that prevented context propagation in some cases. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12708\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12708</a>)</li>\n<li>Fix re-rendering of components using <code class=\"gatsby-code-text\">forwardRef()</code> on a deeper <code class=\"gatsby-code-text\">setState()</code>. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12690\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12690</a>)</li>\n<li>Fix some attributes incorrectly getting removed from custom element nodes. (<a href=\"https://github.com/airamrguez\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@airamrguez</a> in <a href=\"https://github.com/facebook/react/pull/12702\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12702</a>)</li>\n<li>Fix context providers to not bail out on children if there’s a legacy context provider above. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12586\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12586</a>)</li>\n<li>Add the ability to specify <code class=\"gatsby-code-text\">propTypes</code> on a context provider component. (<a href=\"https://github.com/nicolevy\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@nicolevy</a> in <a href=\"https://github.com/facebook/react/pull/12658\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12658</a>)</li>\n<li>Fix a false positive warning when using <code class=\"gatsby-code-text\">react-lifecycles-compat</code> in <code class=\"gatsby-code-text\">&lt;StrictMode&gt;</code>. (<a href=\"https://github.com/bvaughn\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@bvaughn</a> in <a href=\"https://github.com/facebook/react/pull/12644\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12644</a>)</li>\n<li>Warn when the <code class=\"gatsby-code-text\">forwardRef()</code> render function has <code class=\"gatsby-code-text\">propTypes</code> or <code class=\"gatsby-code-text\">defaultProps</code>. (<a href=\"https://github.com/bvaughn\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@bvaughn</a> in <a href=\"https://github.com/facebook/react/pull/12644\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12644</a>)</li>\n<li>Improve how <code class=\"gatsby-code-text\">forwardRef()</code> and context consumers are displayed in the component stack. (<a href=\"https://github.com/sophiebits\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@sophiebits</a> in <a href=\"https://github.com/facebook/react/pull/12777\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12777</a>)</li>\n<li>Change internal event names. This can break third-party packages that rely on React internals in unsupported ways. (<a href=\"https://github.com/philipp-spiess\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@philipp-spiess</a> in <a href=\"https://github.com/facebook/react/pull/12629\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12629</a>)</li>\n</ul>\n<h3 id=\"react-test-renderer\"><a href=\"#react-test-renderer\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React Test Renderer </h3>\n<ul>\n<li>Fix the <code class=\"gatsby-code-text\">getDerivedStateFromProps()</code> support to match the new React DOM behavior. (<a href=\"https://github.com/koba04\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@koba04</a> in <a href=\"https://github.com/facebook/react/pull/12676\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12676</a>)</li>\n<li>Fix a <code class=\"gatsby-code-text\">testInstance.parent</code> crash when the parent is a fragment or another special node. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12813\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12813</a>)</li>\n<li><code class=\"gatsby-code-text\">forwardRef()</code> components are now discoverable by the test renderer traversal methods. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12725\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12725</a>)</li>\n<li>Shallow renderer now ignores <code class=\"gatsby-code-text\">setState()</code> updaters that return <code class=\"gatsby-code-text\">null</code> or <code class=\"gatsby-code-text\">undefined</code>. (<a href=\"https://github.com/koba04\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@koba04</a> in <a href=\"https://github.com/facebook/react/pull/12756\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12756</a>)</li>\n</ul>\n<h3 id=\"react-art\"><a href=\"#react-art\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React ART </h3>\n<ul>\n<li>Fix reading context provided from the tree managed by React DOM. (<a href=\"https://github.com/acdlite\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@acdlite</a> in <a href=\"https://github.com/facebook/react/pull/12779\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12779</a>)</li>\n</ul>\n<h3 id=\"react-call-return-experimental\"><a href=\"#react-call-return-experimental\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React Call Return (Experimental) </h3>\n<ul>\n<li>This experiment was deleted because it was affecting the bundle size and the API wasn’t good enough. It’s likely to come back in the future in some other form. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12820\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12820</a>)</li>\n</ul>\n<h3 id=\"react-reconciler-experimental\"><a href=\"#react-reconciler-experimental\" aria-hidden class=\"anchor\"><svg aria-hidden=\"true\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>React Reconciler (Experimental) </h3>\n<ul>\n<li>The <a href=\"https://github.com/facebook/react/blob/c601f7a64640290af85c9f0e33c78480656b46bc/packages/react-noop-renderer/src/createReactNoop.js#L82-L285\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">new host config shape</a> is flat and doesn’t use nested objects. (<a href=\"https://github.com/gaearon\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">@gaearon</a> in <a href=\"https://github.com/facebook/react/pull/12792\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#12792</a>)</li>\n</ul>","excerpt":"The latest minor release adds support for an oft-requested feature: pointer events! It also includes a bugfix for . Check out the full changelog below. Pointer Events  The following event types are now available in React DOM:           Please note that these events will only work in browsers that support the Pointer Events specification. (At the time of this writing, this includes the latest versions of Chrome, Firefox, Edge, and Internet Explorer.) If your application depends on pointer events…","frontmatter":{"title":"React v16.4.0: Pointer Events","next":null,"prev":null,"author":[{"frontmatter":{"name":"Andrew Clark","url":"https://twitter.com/acdlite"}}]},"fields":{"date":"May 23, 2018","path":"content/blog/2018-05-23-react-v-16-4.md","slug":"/blog/2018/05/23/react-v-16-4.html"}},"allMarkdownRemark":{"edges":[{"node":{"frontmatter":{"title":"Introducing the New JSX Transform"},"fields":{"slug":"/blog/2020/09/22/introducing-the-new-jsx-transform.html"}}},{"node":{"frontmatter":{"title":"React v17.0 Release Candidate: No New Features"},"fields":{"slug":"/blog/2020/08/10/react-v17-rc.html"}}},{"node":{"frontmatter":{"title":"React v16.13.0"},"fields":{"slug":"/blog/2020/02/26/react-v16.13.0.html"}}},{"node":{"frontmatter":{"title":"Building Great User Experiences with Concurrent Mode and Suspense"},"fields":{"slug":"/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html"}}},{"node":{"frontmatter":{"title":"Preparing for the Future with React Prereleases"},"fields":{"slug":"/blog/2019/10/22/react-release-channels.html"}}},{"node":{"frontmatter":{"title":"Introducing the New React DevTools"},"fields":{"slug":"/blog/2019/08/15/new-react-devtools.html"}}},{"node":{"frontmatter":{"title":"React v16.9.0 and the Roadmap Update"},"fields":{"slug":"/blog/2019/08/08/react-v16.9.0.html"}}},{"node":{"frontmatter":{"title":"Is React Translated Yet? ¡Sí! Sim! はい！"},"fields":{"slug":"/blog/2019/02/23/is-react-translated-yet.html"}}},{"node":{"frontmatter":{"title":"React v16.8: The One With Hooks"},"fields":{"slug":"/blog/2019/02/06/react-v16.8.0.html"}}},{"node":{"frontmatter":{"title":"React v16.7: No, This Is Not the One With Hooks"},"fields":{"slug":"/blog/2018/12/19/react-v-16-7.html"}}}]}},"pageContext":{"slug":"/blog/2018/05/23/react-v-16-4.html"}},"staticQueryHashes":[]}