useSlot
Module
import { useSlot } from "@atomico/hooks/use-slot";Syntax
const optionalFilter = (element)=> element instanceof MyCustomElement;
const childNodes = useSlot(ref, optionalFilter);Where:
ref: Reference of the slot to observe.childNodes: List of nodes assigned to the observed slot.optionalFilter: allows to filter nodes assign to childNodes
Live example
Last updated
Was this helpful?
