chore: improve useCombinedRefs (#27352)

This commit is contained in:
Tom Xu 2020-10-24 23:52:59 +08:00 committed by GitHub
parent 96bb0cf2db
commit 5e85ce47a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ import { fillRef } from '../ref';
function useCombinedRefs<T>(
...refs: Array<React.MutableRefObject<T> | ((instance: T) => void) | null>
) {
const targetRef = React.useRef();
const targetRef = React.useRef<T>();
React.useEffect(() => {
refs.forEach(ref => {