import * as React from "react";

export function LazyPreload(
  importStatement: Parameters<typeof React.lazy>[0],
): ReturnType<typeof React.lazy> & { preload: () => void } {
  const Component = React.lazy(importStatement) as any;
  Component.preload = importStatement;
  return Component;
}
