Skip to content

Commit

Permalink
fix: 修复tsdx错误
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuan committed Feb 28, 2024
1 parent e73212d commit 48d1afb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import type { IProps } from "./type";

const NativeActivity = (
"Activity" in React
? React.Activity
// @ts-ignore
? React.Activity as ExoticComponent<IProps>
: "unstable_Activity" in React
? React.unstable_Activity
// @ts-ignore
? React.unstable_Activity as ExoticComponent<IProps>
: null
) as ExoticComponent<IProps> | null;
);

export const Activity: FC<IProps> = (props) => {
const { mode, children } = props;
Expand Down
3 changes: 2 additions & 1 deletion src/Repeater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export const Repeater: FC<IProps> = (props) => {
}

const promise = promiseRef.current!;

// @ts-ignore
if ("use" in React && typeof React.use === "function") {
// @ts-ignore
(React.use as <T>(primise: Promise<T>) => T)(promise);
} else {
throw promise;
Expand Down

0 comments on commit 48d1afb

Please sign in to comment.