Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 1 addition & 12 deletions apps/ts-minbar-test-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as fs from 'fs';
import * as path from 'path';

import {
Expand All @@ -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',
Expand All @@ -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`);

Expand Down
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"dependentChangeType": "patch"
}
4 changes: 2 additions & 2 deletions packages/react/etc/react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9462,7 +9462,7 @@ export interface ITooltipHost {
}

// @public
export interface ITooltipHostProps extends React_2.HTMLAttributes<HTMLDivElement | TooltipHostBase> {
export interface ITooltipHostProps extends Omit<React_2.HTMLAttributes<HTMLDivElement | TooltipHostBase>, 'content'> {
calloutProps?: ICalloutProps;
className?: string;
closeDelay?: number;
Expand Down Expand Up @@ -9504,7 +9504,7 @@ export interface ITooltipHostStyles {
}

// @public (undocumented)
export interface ITooltipProps extends React_2.HTMLAttributes<HTMLDivElement | TooltipBase> {
export interface ITooltipProps extends Omit<React_2.HTMLAttributes<HTMLDivElement | TooltipBase>, 'content'> {
calloutProps?: ICalloutProps;
componentRef?: IRefObject<ITooltip>;
content?: string | JSX.Element | JSX.Element[];
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Tooltip/Tooltip.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ITooltip {}
/**
* {@docCategory Tooltip}
*/
export interface ITooltipProps extends React.HTMLAttributes<HTMLDivElement | TooltipBase> {
export interface ITooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement | TooltipBase>, 'content'> {
/**
* Optional callback to access the ITooltip interface. Use this instead of ref for accessing
* the public methods and properties of the component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLDivElement | TooltipHostBase> {
export interface ITooltipHostProps extends Omit<React.HTMLAttributes<HTMLDivElement | TooltipHostBase>, 'content'> {
/**
* Optional callback to access the ITooltipHost interface. Use this instead of ref for accessing
* the public methods and properties of the component.
Expand Down