diff --git a/shims/jsxRuntime.ts b/shims/jsxRuntime.ts index 7352a679..81b54bd5 100644 --- a/shims/jsxRuntime.ts +++ b/shims/jsxRuntime.ts @@ -4,6 +4,10 @@ import { findByPropsLazy } from "@metro/wrappers"; const jsxRuntime = findByPropsLazy("jsx", "jsxs", "Fragment"); function unproxyFirstArg(args: T[]) { + if (!args[0]) { + throw new Error("The first argument (Component) is falsy. Ensure that you are passing a valid component."); + } + const factory = getProxyFactory(args[0]); if (factory) args[0] = factory(); return args; diff --git a/src/lib/index.ts b/src/lib/index.ts index 37914766..72307862 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -12,6 +12,10 @@ export * as metro from "@metro"; import * as fonts from "./fonts"; import * as plugins from "./plugins"; import * as themes from "./themes"; + +/** @internal */ +export * as _jsx from "react/jsx-runtime"; + import { proxyLazy } from "./utils/lazy"; export const managers = proxyLazy(() => { diff --git a/src/metro/common/index.ts b/src/metro/common/index.ts index 0f6f27a5..04618a59 100644 --- a/src/metro/common/index.ts +++ b/src/metro/common/index.ts @@ -2,6 +2,8 @@ import { findByFilePathLazy, findByProps, findByPropsLazy } from "@metro/wrapper import type { Dispatcher } from "./types/flux"; +export * as components from "./components"; + // Discord export const constants = findByPropsLazy("Fonts", "Permissions"); export const channels = findByPropsLazy("getVoiceChannelId");