Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-utilities): exposes internal methods used in API surface #25406

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "exposes internal methods that are used in the API surface",
"packageName": "@fluentui/react-utilities",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function isResolvedShorthand<Shorthand extends Slot<UnknownSlotProps>>(sh
// @internal
export function mergeCallbacks<Args extends unknown[]>(callback1: ((...args: Args) => void) | undefined, callback2: ((...args: Args) => void) | undefined): (...args: Args) => void;

// @internal
// @public
export type RefObjectFunction<T> = React_2.RefObject<T> & ((value: T) => void);

// @public
Expand Down Expand Up @@ -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<TriggerChildProps = unknown> = {
children?: React_2.ReactElement | ((props: TriggerChildProps) => React_2.ReactElement | null) | null;
};
Expand All @@ -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<T>(...refs: (React_2.Ref<T> | undefined)[]): RefObjectFunction<T>;

// @internal (undocumented)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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<T> = React.RefObject<T> & ((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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down