File tree Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Expand file tree Collapse file tree 3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const REACT_FORWARD_SYMBOL = Symbol.for('react.forward_ref');
66 * Pass ref down to a child. This is mainly used in libraries with HOCs that
77 * wrap components. Using `forwardRef` there is an easy way to get a reference
88 * of the wrapped component instead of one of the wrapper itself.
9- * @param {import('./index').ForwardFn } fn
9+ * @param {import('./index').ForwardRefRenderFunction } fn
1010 * @returns {import('./internal').FunctionComponent }
1111 */
1212export function forwardRef ( fn ) {
Original file line number Diff line number Diff line change @@ -335,14 +335,6 @@ declare namespace React {
335335 ref ?: preact1 . Ref < R > | undefined ;
336336 }
337337
338- /**
339- * @deprecated Please use `ForwardRefRenderFunction` instead.
340- */
341- export interface ForwardFn < P = { } , T = any > {
342- ( props : P , ref : ForwardedRef < T > ) : preact1 . ComponentChild ;
343- displayName ?: string ;
344- }
345-
346338 export interface ForwardRefRenderFunction < T = any , P = { } > {
347339 ( props : P , ref : ForwardedRef < T > ) : preact1 . ComponentChild ;
348340 displayName ?: string ;
Original file line number Diff line number Diff line change 11import React from '../../src' ;
22
3- const MyInput : React . ForwardFn < { id : string } , { focus ( ) : void } > = (
4- props ,
5- ref
6- ) => {
3+ const MyInput : React . ForwardRefRenderFunction <
4+ { focus ( ) : void } ,
5+ { id : string }
6+ > = ( props , ref ) => {
77 const inputRef = React . useRef < HTMLInputElement > ( null ) ;
88
99 React . useImperativeHandle ( ref , ( ) => ( {
You can’t perform that action at this time.
0 commit comments