Skip to content

Commit

Permalink
docs(events): update type conflict recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanner Reits committed Dec 13, 2023
1 parent e16218a commit 0b16d89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/components/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ export class TodoList {
```

:::note
In the case where the Stencil `Event` type conflicts with the native web `Event` type, it is suggested that the native web `Event` type be prefixed with `globalThis`:
```ts title="Preventing Event Type Collisions"
@Event() myEvent: EventEmitter<{value: string, ev: globalThis.Event}>;
In the case where the Stencil `Event` type conflicts with the native web `Event` type, the Stencil `Event` import can be aliased like so:
```tsx
import { Event as StencilEvent, EventEmitter } from '@stencil/core';

@StencilEvent() myEvent: EventEmitter<{value: string, ev: Event}>;
```
:::

Expand Down

0 comments on commit 0b16d89

Please sign in to comment.