import * as React from 'react'; import { useIsomorphicLayoutEffect, useRefEffect } from '@fluentui/react-hooks'; import { getWindow } from '@fluentui/utilities'; import { observeResize } from './observeResize'; /** * Track whether any items don't fit within their container, and move them to the overflow menu. * Items are moved into the overflow menu from back to front, excluding pinned items. * * The overflow menu button must be the last sibling of all of the items that can be put into the overflow, and it * must be hooked up to the `setMenuButtonRef` setter function that's returned by `useOverflow`: * ```ts * const overflow = useOverflow(...); * ``` * ```jsx * * // Index 0 * // Index 1 * ... *