Skip to content

Commit de2eab0

Browse files
authored
Add statics to forwardRef (#1475)
1 parent 61d5e9f commit de2eab0

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

generatedTypes/src/commons/forwardRef.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export interface ForwardRefInjectedProps {
55
*/
66
forwardedRef: any;
77
}
8-
export default function forwardRef<P = any>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P>;
8+
export default function forwardRef<P = any, STATICS = {}>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P> & STATICS;

src/commons/forwardRef.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface ForwardRefInjectedProps {
88
forwardedRef: any;
99
}
1010

11-
export default function forwardRef<P = any>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P> {
11+
export default function forwardRef<P = any, STATICS = {}>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P> & STATICS {
1212
function forwardRef(props: P, ref: any) {
1313
return <WrappedComponent {...props} forwardedRef={ref}/>;
1414
}
@@ -24,4 +24,3 @@ export default function forwardRef<P = any>(WrappedComponent: React.ComponentTyp
2424

2525
return ForwardedComponent as any;
2626
}
27-

0 commit comments

Comments
 (0)