From 963a7332b4daa183ec2d8d3ddf10f3f73b01746a Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 6 Nov 2022 18:37:01 +0100 Subject: Migrate proxied components to and fix LazyComponent --- src/utils/misc.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/utils') diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx index 653f6bf..e52a57f 100644 --- a/src/utils/misc.tsx +++ b/src/utils/misc.tsx @@ -74,10 +74,11 @@ export function useAwaiter(factory: () => Promise, fallbackValue: T | null * @param factory Function returning a Component * @returns Result of factory function */ -export function LazyComponent(factory: () => React.ComponentType) { +export function LazyComponent(factory: () => React.ComponentType) { + const get = makeLazy(factory); return (props: T) => { - const Component = React.useMemo(factory, []); - return ; + const Component = get(); + return ; }; } -- cgit