Document useMergedRefs
This commit is contained in:
parent
8c818b9ce1
commit
ef4a62ca62
1 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
import { MutableRefObject, RefCallback, useCallback } from "react";
|
||||
|
||||
/**
|
||||
* Combines multiple refs into one, useful for attaching multiple refs to the
|
||||
* same DOM node.
|
||||
*/
|
||||
export const useMergedRefs = <T>(
|
||||
...refs: (MutableRefObject<T | null> | RefCallback<T | null>)[]
|
||||
): RefCallback<T | null> =>
|
||||
|
|
Loading…
Add table
Reference in a new issue