Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion demo/src/activities/Article.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { InferActivityParams } from "@stackflow/config";
import {
type ActivityComponentType,
useActivityParams,
Expand All @@ -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<typeof articleLoader>();

Expand Down
4 changes: 1 addition & 3 deletions integrations/react/src/__internal__/ActivityComponentType.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { LazyActivityComponentType } from "./LazyActivityComponentType";
import type { StaticActivityComponentType } from "./StaticActivityComponentType";

export type ActivityComponentType<T extends { [K in keyof T]: any } = {}> =
| StaticActivityComponentType<T>
| LazyActivityComponentType<T>;
StaticActivityComponentType<T>;
8 changes: 6 additions & 2 deletions integrations/react/src/future/ActivityComponentType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ActivityName extends RegisteredActivityName> =
React.ComponentType<{ params: InferActivityParams<ActivityName> }>;
| StaticActivityComponentType<InferActivityParams<ActivityName>>
| LazyActivityComponentType<InferActivityParams<ActivityName>>;

export type { StaticActivityComponentType, LazyActivityComponentType };
2 changes: 1 addition & 1 deletion integrations/react/src/future/loader/loaderPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<
Expand Down
2 changes: 1 addition & 1 deletion integrations/react/src/future/stackflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ 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";
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";
Expand Down
Loading