diff --git a/integrations/react/src/future/stackflow.tsx b/integrations/react/src/future/stackflow.tsx index 88bed2587..1ad368d7f 100644 --- a/integrations/react/src/future/stackflow.tsx +++ b/integrations/react/src/future/stackflow.tsx @@ -31,12 +31,11 @@ export type StackflowPluginsEntry = export type StackflowInput< T extends ActivityDefinition, - R extends { - [activityName in T["name"]]: ActivityComponentType; - }, > = { config: Config; - components: R; + components: { + [activityName in T["name"]]: ActivityComponentType; + } & Record; plugins?: Array; }; @@ -47,11 +46,14 @@ export type StackflowOutput = { }; export function stackflow< - T extends ActivityDefinition, - R extends { - [activityName in T["name"]]: ActivityComponentType; - }, ->(input: StackflowInput): StackflowOutput { + T extends Config>, +>(input: { + config: T; + components: { + [K in T["activities"][number]["name"]]: ActivityComponentType; + }; + plugins?: Array; +}): StackflowOutput { const plugins = [ ...(input.plugins ?? []) .flat(Number.POSITIVE_INFINITY as 0)