Skip to content

Commit 03dfeba

Browse files
committed
ACT-43 Add controllerRef prop to StartControllerScope type
1 parent f889014 commit 03dfeba

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/controller/ApplicationController.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
import React, { ComponentProps, useContext, useEffect, useState } from 'react';
1+
import React, {
2+
ComponentProps,
3+
Ref,
4+
useContext,
5+
useEffect,
6+
useState,
7+
} from 'react';
28
import type { ComponentType, FC, ReactNode } from 'react';
39
// @ts-ignore
410
import { store } from '@aha-app/react-easy-state';
@@ -277,7 +283,11 @@ function StartControllerScope<
277283
>(
278284
ControllerClass: T,
279285
ControlledComponent: C
280-
): ComponentType<GetControllerProps<T> & ComponentProps<C>> {
286+
): ComponentType<
287+
GetControllerProps<T> & {
288+
controllerRef?: Ref<InstanceType<T>>;
289+
} & ComponentProps<C>
290+
> {
281291
// Use React.memo here so if props don't change then we don't re-render and
282292
// allocate a new controller instance.
283293
return React.memo((controllerInitialArgs: any) => {

0 commit comments

Comments
 (0)