diff --git a/src/utils/lazy.ts b/src/utils/lazy.ts index 69d6961f7..5a264ddec 100644 --- a/src/utils/lazy.ts +++ b/src/utils/lazy.ts @@ -30,6 +30,7 @@ export function makeLazy(factory: () => T, attempts = 5, { isIndirect = false }; getter.$$vencordLazyFailed = () => tries === attempts; + return getter; } diff --git a/src/utils/lazyReact.tsx b/src/utils/lazyReact.tsx index 97343f370..dbac8df4b 100644 --- a/src/utils/lazyReact.tsx +++ b/src/utils/lazyReact.tsx @@ -12,6 +12,7 @@ export type LazyComponentType

= React.FunctionC [SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType

| null; }; export type AnyLazyComponentType

= LazyComponentType

; +export type AnyLazyComponentTypeWithChildren

= AnyLazyComponentType>; /** * A lazy component. The factory method is called on first render. diff --git a/src/webpack/common/types/components.d.ts b/src/webpack/common/types/components.d.ts index fa9396718..f8946739b 100644 --- a/src/webpack/common/types/components.d.ts +++ b/src/webpack/common/types/components.d.ts @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import { AnyLazyComponentTypeWithChildren } from "@utils/lazyReact"; import type { ComponentType, CSSProperties, FunctionComponent, HtmlHTMLAttributes, HTMLProps, KeyboardEvent, MouseEvent, PropsWithChildren, PropsWithRef, ReactNode, Ref } from "react"; import { IconNames } from "./iconNames"; @@ -371,7 +372,7 @@ export type Slider = ComponentType>; // TODO - type maybe idk probably not that useful other than the constants -export type Flex = ComponentType> & { +export type Flex = AnyLazyComponentTypeWithChildren & { Align: Record<"START" | "END" | "CENTER" | "STRETCH" | "BASELINE", string>; Direction: Record<"VERTICAL" | "HORIZONTAL" | "HORIZONTAL_REVERSE", string>; Justify: Record<"START" | "END" | "CENTER" | "BETWEEN" | "AROUND", string>;