create-expo-cljs-app
Version:
Create a react native application with Expo and Shadow-CLJS!
18 lines (17 loc) • 338 B
JavaScript
/**
* @private
* find if a node is in the given parent
* @method hasParent
* @param {HTMLElement} node
* @param {HTMLElement} parent
* @return {Boolean} found
*/
export default function hasParent(node, parent) {
while (node) {
if (node === parent) {
return true;
}
node = node.parentNode;
}
return false;
}