type HOC = (Component: React.ComponentType

) => React.ComponentType type AsyncComponent

= () => Promise<{ default: React.ComponentType

}> const withHoc = (asyncComponent: AsyncComponent

, hoc: HOC) => { return async () => { const { default: component } = await asyncComponent(); return { default: hoc(component) }; }; }; export default withHoc;