diff --git a/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json b/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json new file mode 100644 index 0000000000000..7dfc5ecaa13ef --- /dev/null +++ b/change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "feat: exposes internal methods that are used in the API surface", + "packageName": "@fluentui/react-utilities", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-utilities/etc/react-utilities.api.md b/packages/react-components/react-utilities/etc/react-utilities.api.md index 1ed485eb38c86..6275961ede1d3 100644 --- a/packages/react-components/react-utilities/etc/react-utilities.api.md +++ b/packages/react-components/react-utilities/etc/react-utilities.api.md @@ -78,7 +78,7 @@ export function isResolvedShorthand>(sh // @internal export function mergeCallbacks(callback1: ((...args: Args) => void) | undefined, callback2: ((...args: Args) => void) | undefined): (...args: Args) => void; -// @internal +// @public export type RefObjectFunction = React_2.RefObject & ((value: T) => void); // @public @@ -133,7 +133,7 @@ export type SlotShorthandValue = React_2.ReactChild | React_2.ReactNode[] | Reac // @public export const SSRProvider: React_2.FC; -// @internal +// @public export type TriggerProps = { children?: React_2.ReactElement | ((props: TriggerChildProps) => React_2.ReactElement | null) | null; }; @@ -160,13 +160,13 @@ export function useForceUpdate(): DispatchWithoutAction; // @public export function useId(prefix?: string, providedId?: string): string; -// @internal +// @public export const useIsomorphicLayoutEffect: typeof React_2.useEffect; // @public export function useIsSSR(): boolean; -// @internal +// @public export function useMergedRefs(...refs: (React_2.Ref | undefined)[]): RefObjectFunction; // @internal (undocumented) diff --git a/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts b/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts index 03a58dbcc4662..7c8a42b8b3196 100644 --- a/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts +++ b/packages/react-components/react-utilities/src/hooks/useIsomorphicLayoutEffect.ts @@ -2,7 +2,6 @@ import * as React from 'react'; import { canUseDOM } from '../ssr/index'; /** - * @internal * React currently throws a warning when using useLayoutEffect on the server. To get around it, we can conditionally * useEffect on the server (no-op) and useLayoutEffect in the browser. We occasionally need useLayoutEffect to * ensure we don't get a render flash for certain operations, but we may also need affected components to render on diff --git a/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts b/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts index 699ec119603fd..11464490c17df 100644 --- a/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts +++ b/packages/react-components/react-utilities/src/hooks/useMergedRefs.ts @@ -1,14 +1,12 @@ import * as React from 'react'; /** - * @internal * A Ref function which can be treated like a ref object in that it has an attached * current property, which will be updated as the ref is evaluated. */ export type RefObjectFunction = React.RefObject & ((value: T) => void); /** - * @internal * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that * updates all provided refs * @param refs - Refs to collectively update with one ref value. diff --git a/packages/react-components/react-utilities/src/trigger/types.ts b/packages/react-components/react-utilities/src/trigger/types.ts index 05f28c581b468..161a500e0642c 100644 --- a/packages/react-components/react-utilities/src/trigger/types.ts +++ b/packages/react-components/react-utilities/src/trigger/types.ts @@ -19,7 +19,6 @@ export type FluentTriggerComponent = { }; /** - * @internal * A trigger may have a children that could be either: * 1. A single element * 2. A render function that will receive properties and must return a valid element or null