Skip to content

Commit

Permalink
fix(react-dialog): removes exposing of internal type FluentTriggerCom…
Browse files Browse the repository at this point in the history
…ponent (microsoft#25408)
  • Loading branch information
bsunderhus authored and NotWoods committed Nov 18, 2022
1 parent 7d577f7 commit bf25940
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "removes exposing of internal type FluentTriggerComponent",
"packageName": "@fluentui/react-dialog",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { ARIAButtonResultProps } from '@fluentui/react-aria';
import { ARIAButtonType } from '@fluentui/react-aria';
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import { JSXElementConstructor } from 'react';
import * as React_2 from 'react';
Expand Down Expand Up @@ -163,7 +162,7 @@ export type DialogTitleSlots = {
export type DialogTitleState = ComponentState<DialogTitleSlots>;

// @public
export const DialogTrigger: React_2.FC<DialogTriggerProps> & FluentTriggerComponent;
export const DialogTrigger: React_2.FC<DialogTriggerProps>;

// @public (undocumented)
export type DialogTriggerAction = 'open' | 'close';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import type { FluentTriggerComponent } from '@fluentui/react-utilities';
* to it's wrapped child, but it won't be able to alter the dialog `open` state anymore,
* in that case the user must provide a `controlled state`
*/
export const DialogTrigger: React.FC<DialogTriggerProps> & FluentTriggerComponent = props => {
export const DialogTrigger: React.FC<DialogTriggerProps> = props => {
const state = useDialogTrigger_unstable(props);

return renderDialogTrigger_unstable(state);
};

DialogTrigger.displayName = 'DialogTrigger';
DialogTrigger.isFluentTriggerComponent = true;
// type casting here is required to ensure internal type FluentTriggerComponent is not leaked
(DialogTrigger as FluentTriggerComponent).isFluentTriggerComponent = true;

0 comments on commit bf25940

Please sign in to comment.