useCallObject
useCallObject(): DailyCall
This hook manages a call object instance.
When manually managing call object instances in React, it's easy to run into issues, like Error: Duplicate DailyIframe instances are not allowed
,
specifically in React's Strict Mode. useCallObject()
helps prevent that.
useCallObject
creates and destroys a call object instance.
useDaily
provides access to the call object instance passed to
or managed by DailyProvider
.
Params (optional)
useCallObject
accepts the same configuration options as createCallObject()
.
Parameter | Type | Description |
---|---|---|
options | DailyFactoryOptions | Contains all factory properties that are passed to createFrame() . Check DailyCall properties for details. |
shouldCreateInstance | Function | Optional callback function with a boolean return to control when the call frame instance should be created. |
Return type
Type | Description |
---|---|
DailyCall | The DailyCall instance. |