Skip to content

add the hook useReflectEvent

Compare
Choose a tag to compare
@UpperCod UpperCod released this 15 Oct 13:37
· 214 commits to master since this release

the useReflectEvent hook reflects the event from the reference origin to the reference destination, the captured event will be canceled

One of the possibilities of this hook is to reflect the events inside shadowDOM to lightDOM, example when using forms

Module

import { useReflectEvent } from "@atomico/hooks/use-reflect-event";

Syntax

useReflectEvent(
    refFrom: Ref<Element>,
    refTo: Ref<Element>,
    event: string,
    filter?: (event:Event)=>boolean
);