Skip to content

Commit

Permalink
Fix tsc checking
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewiggins committed Jun 15, 2023
1 parent 88cd88f commit 2718488
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions packages/react/runtime/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
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";

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<T>(jsx: T): T {
if (typeof jsx !== "function") return jsx;

Expand Down
7 changes: 7 additions & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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();

0 comments on commit 2718488

Please sign in to comment.