diff --git a/apps/ts-minbar-test-react/src/index.ts b/apps/ts-minbar-test-react/src/index.ts index da1ecaff5a6cae..b268f2e16afbb0 100644 --- a/apps/ts-minbar-test-react/src/index.ts +++ b/apps/ts-minbar-test-react/src/index.ts @@ -1,4 +1,3 @@ -import * as fs from 'fs'; import * as path from 'path'; import { @@ -25,13 +24,10 @@ async function performTest() { tempPaths = prepareTempDirs(`${testName}-`); logger(`✔️ Temporary directories created under ${tempPaths.root}`); - // https://github.com/microsoft/fluentui/issues/27425 - remove related logic once issue will be resolved - const pinnedReactTypesVersion = '17.0.55'; - // Install dependencies, using the minimum TS version supported for consumers const dependencies = [ '@types/node@14', - `@types/react@${pinnedReactTypesVersion}`, + `@types/react@17`, '@types/react-dom@17', 'react@17', 'react-dom@17', @@ -44,13 +40,6 @@ async function performTest() { const packedPackages = await packProjectPackages(logger, lernaRoot, ['@fluentui/react']); await addResolutionPathsForProjectPackages(tempPaths.testApp); - // Remove Start - once will be resolved https://github.com/microsoft/fluentui/issues/27425 - const jsonPath = path.resolve(tempPaths.testApp, 'package.json'); - const packageJson = JSON.parse(fs.readFileSync(jsonPath, 'utf-8')); - packageJson.resolutions['@types/react-dom/@types/react'] = pinnedReactTypesVersion; - fs.writeFileSync(jsonPath, JSON.stringify(packageJson), 'utf-8'); - // Remove End - await shEcho(`yarn add ${packedPackages['@fluentui/react']}`, tempPaths.testApp); logger(`✔️ Fluent UI packages were added to dependencies`); diff --git a/change/@fluentui-react-46a490a8-de1f-44df-84dc-99f9d17a8db8.json b/change/@fluentui-react-46a490a8-de1f-44df-84dc-99f9d17a8db8.json new file mode 100644 index 00000000000000..e1175cec7d1741 --- /dev/null +++ b/change/@fluentui-react-46a490a8-de1f-44df-84dc-99f9d17a8db8.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: exclude HTMLAttributes defined 'content' for Tooltip and TooltipHost Prop types to mitigate @types/react breaking changes", + "packageName": "@fluentui/react", + "email": "martinhochel@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react/etc/react.api.md b/packages/react/etc/react.api.md index c17aa0c86fd5e7..92a5709c5c949c 100644 --- a/packages/react/etc/react.api.md +++ b/packages/react/etc/react.api.md @@ -9462,7 +9462,7 @@ export interface ITooltipHost { } // @public -export interface ITooltipHostProps extends React_2.HTMLAttributes { +export interface ITooltipHostProps extends Omit, 'content'> { calloutProps?: ICalloutProps; className?: string; closeDelay?: number; @@ -9504,7 +9504,7 @@ export interface ITooltipHostStyles { } // @public (undocumented) -export interface ITooltipProps extends React_2.HTMLAttributes { +export interface ITooltipProps extends Omit, 'content'> { calloutProps?: ICalloutProps; componentRef?: IRefObject; content?: string | JSX.Element | JSX.Element[]; diff --git a/packages/react/src/components/Tooltip/Tooltip.types.ts b/packages/react/src/components/Tooltip/Tooltip.types.ts index c540fc09efac69..0aae7cdb46f7a3 100644 --- a/packages/react/src/components/Tooltip/Tooltip.types.ts +++ b/packages/react/src/components/Tooltip/Tooltip.types.ts @@ -13,7 +13,7 @@ export interface ITooltip {} /** * {@docCategory Tooltip} */ -export interface ITooltipProps extends React.HTMLAttributes { +export interface ITooltipProps extends Omit, 'content'> { /** * Optional callback to access the ITooltip interface. Use this instead of ref for accessing * the public methods and properties of the component. diff --git a/packages/react/src/components/Tooltip/TooltipHost.types.ts b/packages/react/src/components/Tooltip/TooltipHost.types.ts index 0567a403109c35..d011cbf4b9d28c 100644 --- a/packages/react/src/components/Tooltip/TooltipHost.types.ts +++ b/packages/react/src/components/Tooltip/TooltipHost.types.ts @@ -41,7 +41,7 @@ export enum TooltipOverflowMode { * passed through to the Tooltip itself, rather than being used on the host element. * {@docCategory Tooltip} */ -export interface ITooltipHostProps extends React.HTMLAttributes { +export interface ITooltipHostProps extends Omit, 'content'> { /** * Optional callback to access the ITooltipHost interface. Use this instead of ref for accessing * the public methods and properties of the component.