import { MutableRefObject, Ref } from 'react'; /** * When a component needs to track an internal ref on a component that has a * forwarded ref, useSharedRef will return a MutableRefObject that will * correctly invoke the parent ref as well providing an internal ref. * * @example * React.forwardRef(function Component({ children }, ref) { * const internalRef = useSharedRef(ref) * if (internalRef.current) { * // do something with the internal ref... * } * return (
...
) * }) */ export default function useSharedRef(ref: Ref): MutableRefObject;