ParentContext type
Home > @rimitive/view > ParentContext
ParentContext type
Section titled “ParentContext type”Parent context passed to RefSpec.create() for adapter composition Allows child RefSpecs to know their parent’s adapter and element
Note: adapter uses ‘unknown’ for variance - any Adapter
Signature:
export type ParentContext<TElement> = { adapter: unknown; element: TElement;};Example
Section titled “Example”import type { ParentContext } from '@rimitive/view/types';
const context: ParentContext<HTMLElement> = { adapter: domAdapter, element: parentElement};
// Used internally when creating child elementsconst childRef = childSpec.create(svc, {}, context);