import type {LazyComponent} from 'react/src/ReactLazy';
export function callComponentInDEV<Props, Arg, R>(
Component: (p: Props, arg: Arg) => R,
props: Props,
secondArg: Arg,
): R {
return Component(props, secondArg);
}
interface ClassInstance<R> {
render(): R;
}
export function callRenderInDEV<R>(instance: ClassInstance<R>): R {
return instance.render();
}
export function callLazyInitInDEV(lazy: LazyComponent<any, any>): any {
const payload = lazy._payload;
const init = lazy._init;
return init(payload);
}