diff --git a/demo/src/activities/Article.tsx b/demo/src/activities/Article.tsx index 27b3df957..74e793e68 100644 --- a/demo/src/activities/Article.tsx +++ b/demo/src/activities/Article.tsx @@ -1,3 +1,4 @@ +import type { InferActivityParams } from "@stackflow/config"; import { type ActivityComponentType, useActivityParams, @@ -19,7 +20,7 @@ declare module "@stackflow/config" { } } -const Article: ActivityComponentType<"Article"> = ({ params }) => { +const Article = ({ params }: { params: InferActivityParams<"Article"> }) => { const { title } = useActivityParams<"Article">(); const { imageUrl, recommenderCards } = useLoaderData(); diff --git a/integrations/react/src/__internal__/ActivityComponentType.ts b/integrations/react/src/__internal__/ActivityComponentType.ts index d325bcfde..c3429a4a0 100644 --- a/integrations/react/src/__internal__/ActivityComponentType.ts +++ b/integrations/react/src/__internal__/ActivityComponentType.ts @@ -1,6 +1,4 @@ -import type { LazyActivityComponentType } from "./LazyActivityComponentType"; import type { StaticActivityComponentType } from "./StaticActivityComponentType"; export type ActivityComponentType = - | StaticActivityComponentType - | LazyActivityComponentType; + StaticActivityComponentType; diff --git a/integrations/react/src/future/ActivityComponentType.tsx b/integrations/react/src/future/ActivityComponentType.tsx index 05fcf1259..dadc84775 100644 --- a/integrations/react/src/future/ActivityComponentType.tsx +++ b/integrations/react/src/future/ActivityComponentType.tsx @@ -2,7 +2,11 @@ import type { InferActivityParams, RegisteredActivityName, } from "@stackflow/config"; -import type React from "react"; +import type { LazyActivityComponentType } from "../__internal__/LazyActivityComponentType"; +import type { StaticActivityComponentType } from "../__internal__/StaticActivityComponentType"; export type ActivityComponentType = - React.ComponentType<{ params: InferActivityParams }>; + | StaticActivityComponentType> + | LazyActivityComponentType>; + +export type { StaticActivityComponentType, LazyActivityComponentType }; diff --git a/integrations/react/src/future/loader/loaderPlugin.tsx b/integrations/react/src/future/loader/loaderPlugin.tsx index 744768db8..43784c2e1 100644 --- a/integrations/react/src/future/loader/loaderPlugin.tsx +++ b/integrations/react/src/future/loader/loaderPlugin.tsx @@ -2,8 +2,8 @@ import type { ActivityDefinition, RegisteredActivityName, } from "@stackflow/config"; -import type { ActivityComponentType } from "../../__internal__/ActivityComponentType"; import type { StackflowReactPlugin } from "../../__internal__/StackflowReactPlugin"; +import type { ActivityComponentType } from "../ActivityComponentType"; import type { StackflowInput } from "../stackflow"; export function loaderPlugin< diff --git a/integrations/react/src/future/stackflow.tsx b/integrations/react/src/future/stackflow.tsx index a5807619d..0370bbc98 100644 --- a/integrations/react/src/future/stackflow.tsx +++ b/integrations/react/src/future/stackflow.tsx @@ -11,7 +11,6 @@ import { makeEvent, } from "@stackflow/core"; import React, { useMemo } from "react"; -import type { ActivityComponentType } from "../__internal__/ActivityComponentType"; import MainRenderer from "../__internal__/MainRenderer"; import { makeActivityId } from "../__internal__/activity"; import { CoreProvider } from "../__internal__/core"; @@ -19,6 +18,7 @@ import { PluginsProvider } from "../__internal__/plugins"; import { isBrowser, makeRef } from "../__internal__/utils"; import type { StackflowReactPlugin } from "../stable"; import type { Actions } from "./Actions"; +import type { ActivityComponentType } from "./ActivityComponentType"; import { ConfigProvider } from "./ConfigProvider"; import type { StackComponentType } from "./StackComponentType"; import type { StepActions } from "./StepActions";