Skip to content

Commit

Permalink
fix: too much recursion error (themustafaomar#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelker committed Mar 22, 2022
1 parent 68be58f commit 320d9eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/util/deepMerge.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function isSpecial(value) {

return stringValue === '[object RegExp]'
|| stringValue === '[object Date]'
|| isReactElement(value)
|| isNode(value)
|| isReactElement(value);
}

// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
Expand All @@ -28,6 +29,10 @@ function isReactElement(value) {
return value.$$typeof === REACT_ELEMENT_TYPE
}

function isNode(value) {
return value instanceof Node;
}

function emptyTarget(val) {
return Array.isArray(val) ? [] : {}
}
Expand Down

0 comments on commit 320d9eb

Please sign in to comment.