Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import * as React from 'react';
import { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';
import { useOverflowContext } from './overflowContext';
/**
* @internal
* Registers an overflow item
* @param groupId - assigns the item to a group, group visibility can be watched
* @returns ref to assign to an intrinsic HTML element
*/ export function useOverflowDivider(groupId) {
const ref = React.useRef(null);
const registerDivider = useOverflowContext((v)=>v.registerDivider);
useIsomorphicLayoutEffect(()=>{
if (ref.current && groupId) {
return registerDivider({
element: ref.current,
groupId
});
}
}, [
registerDivider,
groupId
]);
return ref;
}