Skip to content

Commit

Permalink
fix(react-utilities): exposes internal methods used in API surface (#…
Browse files Browse the repository at this point in the history
…25406)

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

* Update change/@fluentui-react-utilities-4b8968e2-4358-44f1-9085-11dc0120eb70.json

Co-authored-by: ling1726 <[email protected]>

Co-authored-by: ling1726 <[email protected]>
  • Loading branch information
bsunderhus and ling1726 authored Oct 28, 2022
1 parent 4d58b78 commit ee9ca8f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: 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

0 comments on commit ee9ca8f

Please sign in to comment.