diff --git a/compat/src/forwardRef.js b/compat/src/forwardRef.js index 1b46bab3ab..5f3ef0035b 100644 --- a/compat/src/forwardRef.js +++ b/compat/src/forwardRef.js @@ -6,7 +6,7 @@ export const REACT_FORWARD_SYMBOL = Symbol.for('react.forward_ref'); * Pass ref down to a child. This is mainly used in libraries with HOCs that * wrap components. Using `forwardRef` there is an easy way to get a reference * of the wrapped component instead of one of the wrapper itself. - * @param {import('./index').ForwardFn} fn + * @param {import('./index').ForwardRefRenderFunction} fn * @returns {import('./internal').FunctionComponent} */ export function forwardRef(fn) { diff --git a/compat/src/index.d.ts b/compat/src/index.d.ts index 29bb5ba82d..093c7d0970 100644 --- a/compat/src/index.d.ts +++ b/compat/src/index.d.ts @@ -335,14 +335,6 @@ declare namespace React { ref?: preact1.Ref | undefined; } - /** - * @deprecated Please use `ForwardRefRenderFunction` instead. - */ - export interface ForwardFn

{ - (props: P, ref: ForwardedRef): preact1.ComponentChild; - displayName?: string; - } - export interface ForwardRefRenderFunction { (props: P, ref: ForwardedRef): preact1.ComponentChild; displayName?: string; diff --git a/compat/test/ts/forward-ref.tsx b/compat/test/ts/forward-ref.tsx index 25d0694079..98aa52b82e 100644 --- a/compat/test/ts/forward-ref.tsx +++ b/compat/test/ts/forward-ref.tsx @@ -1,9 +1,9 @@ import React from '../../src'; -const MyInput: React.ForwardFn<{ id: string }, { focus(): void }> = ( - props, - ref -) => { +const MyInput: React.ForwardRefRenderFunction< + { focus(): void }, + { id: string } +> = (props, ref) => { const inputRef = React.useRef(null); React.useImperativeHandle(ref, () => ({