Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15940

Dynamic import opentok/client

$
0
0

I want to reduce my bundle size so i am trying to change this importimport OT, { Device, Publisher, Session, SubscriberProperties } from '@opentok/client';

I am importing this into context provider.const OT = React.lazy(()=> import('@opentok/client'));But at import am facing this .ts errorType 'Promise<{ default: typeof OT; checkScreenSharingCapability(callback: (response: ScreenSharingCapabilityResponse) => void): void; checkSystemRequirements(): number; ... 25 more ...; Subscriber: typeof Subscriber; }>' is not assignable to type 'Promise<{ default: ComponentType; }>'.Type '{ default: typeof OT; checkScreenSharingCapability(callback: (response: ScreenSharingCapabilityResponse) => void): void; checkSystemRequirements(): number; ... 25 more ...; Subscriber: typeof Subscriber; }' is not assignable to type '{ default: ComponentType; }'.Types of property 'default' are incompatible.Type 'typeof OT' is not assignable to type 'ComponentType'.ts(2322)


Viewing all articles
Browse latest Browse all 15940


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>