function useMergedRef(refA, refB) {
  return React.useMemo(() => {
    if (!refA && !refB) {
      return null
    }

    return node => {
      setRef(refA, node)
      setRef(refB, node)
    }
  }, [refA, refB])
}
React hook that merges up to two React refs into a single memoized function React Ref
@param {import('react').Ref<any>} refA
@param {import('react').Ref<any>} [refB]