Skip to content

Commit

Permalink
Correct type of ref in forwardRef render() (#13100)
Browse files Browse the repository at this point in the history
`React$ElementRef<T>` is the type of the ref _instance_ for a component of type T, whereas `React$Ref<T>` is the type of the ref _prop_ for a component of type T, which seems to be the intended type here.
  • Loading branch information
motiz88 authored and bvaughn committed Jul 11, 2018
1 parent 7b99cea commit f89f25f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/forwardRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {REACT_FORWARD_REF_TYPE} from 'shared/ReactSymbols';
import warning from 'shared/warning';

export default function forwardRef<Props, ElementType: React$ElementType>(
render: (props: Props, ref: React$ElementRef<ElementType>) => React$Node,
render: (props: Props, ref: React$Ref<ElementType>) => React$Node,
) {
if (__DEV__) {
if (typeof render !== 'function') {
Expand Down

0 comments on commit f89f25f

Please sign in to comment.