# use-reflect-event

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

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

### Syntax useReflectEvent

```typescript
useReflectEvent(
    refFrom: Ref<Element>,
    refTo: Ref<Element>,
    eventType: string
);
```

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

### Syntax reflectEvent

```javascript
reflectEvent( target: Element, event: Event );
```

Reflects on an element the given event


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://atomico.gitbook.io/doc/packages/atomico-hooks/use-reflect-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
