Skip to content

Commit db7f4c3

Browse files
committed
Remove import React default
1 parent 716c29f commit db7f4c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ComponentType, createElement } from "react";
1+
import { ComponentType, createElement, lazy } from "react";
22

33
export type PreloadableComponent<T extends ComponentType<any>> = T & {
44
preload: () => Promise<void>;
@@ -7,7 +7,7 @@ export type PreloadableComponent<T extends ComponentType<any>> = T & {
77
export default function lazyWithPreload<T extends ComponentType<any>>(
88
factory: () => Promise<{ default: T }>
99
): PreloadableComponent<T> {
10-
const LazyComponent = React.lazy(factory);
10+
const LazyComponent = lazy(factory);
1111
let factoryPromise: Promise<void> | undefined;
1212
let LoadedComponent: T | undefined;
1313

0 commit comments

Comments
 (0)