From 696031d913971af226e71cba7b60ffd36dfb0a92 Mon Sep 17 00:00:00 2001 From: Bnaya Peretz Date: Mon, 7 Oct 2019 22:13:11 +0300 Subject: [PATCH] React 16.10 patch support --- src/webpack/patch.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/webpack/patch.js b/src/webpack/patch.js index 8e0b32fbe..f83d33e09 100644 --- a/src/webpack/patch.js +++ b/src/webpack/patch.js @@ -1,4 +1,8 @@ const injectionStart = { + '16.10': [ + 'if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element)))', + 'if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : hotCompareElements(child.elementType, element.type, hotUpdateChild(child), child.type))' + ], '16.9': [ 'if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || (\n // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element)))', 'if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : hotCompareElements(child.elementType, element.type, hotUpdateChild(child), child.type))' @@ -22,6 +26,10 @@ const injectionStart = { }; const additional = { + '16.10-update': [ + '( // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current$$1, element)))', + '(hotCompareElements(current$$1.elementType, element.type, hotUpdateChild(current$$1), current$$1.type)))' + ], '16.9-update': [ '(\n // Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current$$1, element)))', '(hotCompareElements(current$$1.elementType, element.type, hotUpdateChild(current$$1), current$$1.type)))' @@ -110,6 +118,7 @@ const defaultEnd = ['var ReactDOM = {', ReactHotLoaderInjection]; const defaultEndCompact = ['var ReactDOM={', ReactHotLoaderInjection]; const injectionEnd = { + '16.10': defaultEnd, '16.9': defaultEnd, '16.6': defaultEnd, '16.4': defaultEnd,