From 2718488c1613ae383c24bda35eaf6e3b6069a520 Mon Sep 17 00:00:00 2001 From: Andre Wiggins Date: Thu, 15 Jun 2023 16:48:22 -0700 Subject: [PATCH] Fix tsc checking --- packages/react/runtime/src/index.ts | 7 ------- packages/react/src/index.ts | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react/runtime/src/index.ts b/packages/react/runtime/src/index.ts index a819e7e96..7f62877b8 100644 --- a/packages/react/runtime/src/index.ts +++ b/packages/react/runtime/src/index.ts @@ -1,6 +1,5 @@ import { signal, computed, effect, Signal } from "@preact/signals-core"; import { useRef, useMemo, useEffect } from "react"; -import type { ReactElement } from "react"; import { useSyncExternalStore } from "use-sync-external-store/shim/index.js"; export { installAutoSignalTracking } from "./auto"; @@ -8,12 +7,6 @@ export { installAutoSignalTracking } from "./auto"; const Empty = [] as const; const ReactElemType = Symbol.for("react.element"); // https://github.com/facebook/react/blob/346c7d4c43a0717302d446da9e7423a8e28d8996/packages/shared/ReactSymbols.js#L15 -declare module "@preact/signals-core" { - // @ts-ignore internal Signal is viewed as function - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface Signal extends ReactElement {} -} - export function wrapJsx(jsx: T): T { if (typeof jsx !== "function") return jsx; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index d07fb0014..1ad99bc05 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -6,6 +6,7 @@ import { Signal, type ReadonlySignal, } from "@preact/signals-core"; +import type { ReactElement } from "react"; import { useSignal, useComputed, useSignalEffect } from "../runtime"; import { installAutoSignalTracking } from "../runtime/src/auto"; @@ -21,4 +22,10 @@ export { useSignalEffect, }; +declare module "@preact/signals-core" { + // @ts-ignore internal Signal is viewed as function + // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface Signal extends ReactElement {} +} + installAutoSignalTracking();