Skip to content

Commit

Permalink
React 16.10 patch support
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnaya committed Oct 7, 2019
1 parent 7060a9b commit 696031d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/webpack/patch.js
Original file line number Diff line number Diff line change
@@ -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))'
Expand All @@ -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)))'
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 696031d

Please sign in to comment.