[ReactUtil > findInTree] Fix passing no opts more

pull/70/head
CanadaHonk 2 years ago committed by GitHub
parent aa53bb78bd
commit 92a1889944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
src/util/react.js vendored

@ -17,8 +17,8 @@ export const getOwnerInstance = (node) => { // Go through React node's parent un
}
};
export const findInTree = (parent, filter, opts = {}) => { // Find in tree utility function - parameters supported like BD's + PC's APIs to maintain compatibility
const { walkable = null, ignore = [] } = opts;
export const findInTree = (parent, filter, opts) => { // Find in tree utility function - parameters supported like BD's + PC's APIs to maintain compatibility
const { walkable = null, ignore = [] } = opts ?? {};
if (!parent || typeof parent !== 'object') { // Parent is invalid to search through
return null;

Loading…
Cancel
Save