({event, listener, options}: ExampleProps)
| 21 | } |
| 22 | |
| 23 | function Example({event, listener, options}: ExampleProps) { |
| 24 | let ref = useRef<HTMLDivElement | null>(null); |
| 25 | useEvent(ref as RefObject<HTMLDivElement | null>, event, listener, options); |
| 26 | return <div ref={ref} data-testid="target" />; |
| 27 | } |
| 28 | |
| 29 | describe('useEvent', () => { |
| 30 | it('subscribes on mount and unsubscribes on unmount', () => { |
nothing calls this directly
no test coverage detected