arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

use-reflect-event

the useReflectEvent hook reflects the event from the reference origin to the reference destination

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

hashtag
module

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

hashtag
Syntax useReflectEvent

useRefectEvent will listen for the eventType of refFrom, to reflect it on refTo

hashtag
Syntax reflectEvent

Reflects on an element the given event

useReflectEvent(
    refFrom: Ref<Element>,
    refTo: Ref<Element>,
    eventType: string
);
reflectEvent( target: Element, event: Event );