Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compat/src/forwardRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 0 additions & 8 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,6 @@ declare namespace React {
ref?: preact1.Ref<R> | undefined;
}

/**
* @deprecated Please use `ForwardRefRenderFunction` instead.
*/
export interface ForwardFn<P = {}, T = any> {
(props: P, ref: ForwardedRef<T>): preact1.ComponentChild;
displayName?: string;
}

export interface ForwardRefRenderFunction<T = any, P = {}> {
(props: P, ref: ForwardedRef<T>): preact1.ComponentChild;
displayName?: string;
Expand Down
8 changes: 4 additions & 4 deletions compat/test/ts/forward-ref.tsx
Original file line number Diff line number Diff line change
@@ -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<HTMLInputElement>(null);

React.useImperativeHandle(ref, () => ({
Expand Down
Loading