diff --git a/packages/composable-controller/src/ComposableController.ts b/packages/composable-controller/src/ComposableController.ts index 4d6d727f3c..4c2ec8ad3b 100644 --- a/packages/composable-controller/src/ComposableController.ts +++ b/packages/composable-controller/src/ComposableController.ts @@ -188,13 +188,13 @@ export type ComposableControllerMessenger< type GetChildControllers< ComposableControllerState, - P extends keyof ComposableControllerState = keyof ComposableControllerState, -> = P extends string - ? ComposableControllerState[P] extends StateConstraint - ? { name: P; state: ComposableControllerState[P] } + ControllerName extends keyof ComposableControllerState = keyof ComposableControllerState, +> = ControllerName extends string + ? ComposableControllerState[ControllerName] extends StateConstraint + ? { name: ControllerName; state: ComposableControllerState[ControllerName] } : BaseControllerV1< BaseConfig & Record, - BaseState & ComposableControllerState[P] + BaseState & ComposableControllerState[ControllerName] > : never;