mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-01 03:29:39 +08:00
chore: improve useCombinedRefs (#27352)
This commit is contained in:
parent
96bb0cf2db
commit
5e85ce47a0
@ -4,7 +4,7 @@ import { fillRef } from '../ref';
|
|||||||
function useCombinedRefs<T>(
|
function useCombinedRefs<T>(
|
||||||
...refs: Array<React.MutableRefObject<T> | ((instance: T) => void) | null>
|
...refs: Array<React.MutableRefObject<T> | ((instance: T) => void) | null>
|
||||||
) {
|
) {
|
||||||
const targetRef = React.useRef();
|
const targetRef = React.useRef<T>();
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
refs.forEach(ref => {
|
refs.forEach(ref => {
|
||||||
|
Loading…
Reference in New Issue
Block a user