@@ -2,7 +2,7 @@ import React from 'react';
22import hoistStatics from 'hoist-non-react-statics' ;
33import * as Modifiers from './modifiers' ;
44import { Scheme , SchemeChangeListener , ThemeManager } from '../style' ;
5- import forwardRef from './forwardRef' ;
5+ import forwardRef , { ForwardRefInjectedProps } from './forwardRef' ;
66import UIComponent from './UIComponent' ;
77
88export interface BaseComponentInjectedProps {
@@ -21,9 +21,9 @@ export interface AsBaseComponentOptions {
2121const EMPTY_MODIFIERS = { } ;
2222const colorScheme = Scheme . getSchemeType ( ) ;
2323
24- function asBaseComponent < PROPS , STATICS = { } > ( WrappedComponent : React . ComponentType < any > ,
25- options : AsBaseComponentOptions = { } ) : React . ComponentClass < PROPS > & STATICS {
26- class BaseComponent extends UIComponent {
24+ function asBaseComponent < PROPS , STATICS = { } , RefInterface = any > ( WrappedComponent : React . ComponentType < any > ,
25+ options : AsBaseComponentOptions = { } ) {
26+ class BaseComponent extends UIComponent < PROPS & ForwardRefInjectedProps < RefInterface > > {
2727 static displayName : string | undefined ;
2828 static propTypes : any ;
2929 static defaultProps : any ;
@@ -85,8 +85,7 @@ function asBaseComponent<PROPS, STATICS = {}>(WrappedComponent: React.ComponentT
8585 if ( ThemeContext ) {
8686 BaseComponent . contextType = ThemeContext ;
8787 }
88-
89- return forwardRef ( BaseComponent ) as any ;
88+ return forwardRef < PROPS , STATICS , RefInterface > ( BaseComponent ) ;
9089}
9190
9291export default asBaseComponent ;
0 commit comments