1+ "use client" ;
12import React , { Suspense } from "react" ;
23import { Repeater } from "./Repeater" ;
34import { canUseDOM } from "./canUseDOM" ;
@@ -7,30 +8,26 @@ import type { IProps } from "./type";
78const isSupportStableActivity = "Activity" in React ;
89const isBrowser = canUseDOM ( ) ;
910
10- const NativeActivity = (
11- isSupportStableActivity
12- // @ts -ignore
13- ? React . Activity as ExoticComponent < IProps >
14- : "unstable_Activity" in React
15- // @ts -ignore
16- ? React . unstable_Activity as ExoticComponent < IProps >
17- : null
18- ) ;
11+ const NativeActivity = isSupportStableActivity
12+ ? // @ts -expect-error React.Activity is not yet fully typed in @types/react
13+ ( React . Activity as ExoticComponent < IProps > )
14+ : "unstable_Activity" in React
15+ ? ( React . unstable_Activity as ExoticComponent < IProps > )
16+ : null ;
1917
20-
21- if ( isBrowser && isSupportStableActivity ) {
18+ if ( isBrowser && isSupportStableActivity ) {
2219 console . warn (
2320 navigator . language === "zh-CN"
24- ? ' 检测到您使用的react版本已经原生支持了Activity,我们 建议您迁移至原生Activity。'
25- : ' It is detected that the react version you are using already supports Activity natively. We recommend that you migrate to native Activity.'
26- )
21+ ? " 检测到您使用的react版本已经原生支持了Activity,我们 建议您迁移至原生Activity。"
22+ : " It is detected that the react version you are using already supports Activity natively. We recommend that you migrate to native Activity." ,
23+ ) ;
2724}
2825
2926/**
30- *
27+ *
3128 * @param {IProps } props
3229 * @description This is a component that keeps its state while hiding it
33- * @example
30+ * @example
3431 * when visible
3532 * <Activity mode="visible">
3633 * <Child />
0 commit comments