<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[`Component`](Component) › [`registerEvent`](Component/registerEvent)
## Component.registerEvent() method
Registers an event to be detached when unloading
**Signature:**
```typescript
registerEvent(eventRef: EventRef): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| <code>eventRef</code> | [`EventRef`](EventRef) | |
**Returns:**
`void`