We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72febae commit 23e9262Copy full SHA for 23e9262
src/hooks/useCallInstance.ts
@@ -37,9 +37,15 @@ export const useCallInstance = (
37
*/
38
const lastUsedOptions = useRef<DailyFactoryOptions>();
39
useEffect(() => {
40
- if (!shouldCreateInstance()) {
+ /**
41
+ * Call frame instances with a defined parentEl likely pass a ref.
42
+ * Typically a DOM ref is initialized with useRef(null).
43
+ * We'll want to wait until parentEl is defined, meaning that the ref is
44
+ * correctly wired up with a DOM element.
45
+ * Otherwise we'll just check shouldCreateInstance().
46
+ */
47
+ if ((type === 'callFrame' && parentEl === null) || !shouldCreateInstance())
48
return;
- }
49
50
async function destroyCallInstance(co: DailyCall) {
51
await co.destroy();
0 commit comments