Retrieve a node higher than the current webcomponent.
Last updated 3 years ago
Was this helpful?
import { useParent, useParentPath } from "@atomico/hooks/use-parent";
const selector = "form"; const parent = useParent(selector);
Where:
selector: String, Selector to be used by when searching for the parent.
selector
String
parent: Element, ascending search result according to selector.
parent
Element
const parents = useParentPath(composed?: boolean);
parents: parent nodes of the webcomponent
parents:
composed: bypasses shadow DOM in parent capture.
composed