useDailyEvent
useDailyEvent(params): void
Registers daily-js
event listeners. The listeners are automatically torn down when a component or hook calling useDailyEvent
gets unmounted.
Params
Parameter | Required | Type | Description |
---|---|---|---|
event | ✓ | string | The daily-js event to register |
callback | ✓ | Function | A memoized callback reference to run when the event is emittedlistener |
The callback
param has to be a memoized reference (e.g. via useCallback
). Otherwise a console error might be thrown indicating a potential re-render loop.
Return type
void