Skip to content

Commit 4df7efe

Browse files
committed
fix(react): remove invalid React.RefAttributes with our custome RefAttributes type
1 parent 592a9f9 commit 4df7efe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+161
-143
lines changed

packages/react/etc/react.api.md

Lines changed: 38 additions & 36 deletions
Large diffs are not rendered by default.

packages/react/src/Utilities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export type {
224224
IRefObject,
225225
IRenderComponent,
226226
IRenderFunction,
227+
RefAttributes,
227228
ISelection,
228229
ISelectionOptions,
229230
ISelectionOptionsWithRequiredGetKey,

packages/react/src/components/Calendar/Calendar.types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import * as React from 'react';
21
import { DayOfWeek, FirstWeekOfYear, DateRangeType } from '@fluentui/date-time-utilities';
3-
import type { IRefObject, IBaseProps, IStyleFunctionOrObject } from '@fluentui/utilities';
2+
import type { IRefObject, IBaseProps, IStyleFunctionOrObject, RefAttributes } from '@fluentui/utilities';
43
import type { IStyle, ITheme } from '@fluentui/style-utilities';
54
import type { ICalendarDayProps } from './CalendarDay/CalendarDay.types';
65
import type { ICalendarMonthProps } from './CalendarMonth/CalendarMonth.types';
@@ -17,7 +16,7 @@ export interface ICalendar {
1716
/**
1817
* {@docCategory Calendar}
1918
*/
20-
export interface ICalendarProps extends IBaseProps<ICalendar>, React.RefAttributes<HTMLDivElement> {
19+
export interface ICalendarProps extends IBaseProps<ICalendar>, RefAttributes<HTMLDivElement> {
2120
/**
2221
* Optional callback to access the ICalendar interface. Use this instead of ref for accessing
2322
* the public methods and properties of the component.

packages/react/src/components/Callout/Callout.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { DirectionalHint } from '../../common/DirectionalHint';
33
import type { IStyle, ITheme } from '../../Styling';
4-
import type { IRectangle, IStyleFunctionOrObject } from '../../Utilities';
4+
import type { IRectangle, IStyleFunctionOrObject, RefAttributes } from '../../Utilities';
55
import type { ICalloutPositionedInfo } from '../../Positioning';
66
import type { ILayerProps } from '../../Layer';
77
import type { IPopupProps } from '../../Popup';
@@ -11,7 +11,7 @@ import type { IPopupRestoreFocusParams } from '../../Popup';
1111
/**
1212
* {@docCategory Callout}
1313
*/
14-
export interface ICalloutProps extends React.HTMLAttributes<HTMLDivElement>, React.RefAttributes<HTMLDivElement> {
14+
export interface ICalloutProps extends React.HTMLAttributes<HTMLDivElement>, RefAttributes<HTMLDivElement> {
1515
/**
1616
* The target that the Callout should try to position itself based on.
1717
* It can be an element, a query selector string of a valid element,

packages/react/src/components/Check/Check.types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import * as React from 'react';
21
import type { IStyle, ITheme } from '../../Styling';
3-
import type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
2+
import type { IRefObject, IStyleFunctionOrObject, RefAttributes } from '../../Utilities';
43

54
/**
65
* {@docCategory Check}
76
*/
8-
export interface ICheckProps extends React.RefAttributes<HTMLDivElement> {
7+
export interface ICheckProps extends RefAttributes<HTMLDivElement> {
98
/**
109
* Gets the component ref.
1110
*/

packages/react/src/components/Checkbox/Checkbox.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import type { IStyle, ITheme } from '@fluentui/style-utilities';
3-
import type { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '@fluentui/utilities';
3+
import type { IRefObject, IRenderFunction, IStyleFunctionOrObject, RefAttributes } from '@fluentui/utilities';
44
import type { IIconProps } from '../Icon/Icon.types';
55

66
/**
@@ -22,7 +22,7 @@ export interface ICheckbox {
2222
* Checkbox properties.
2323
* {@docCategory Checkbox}
2424
*/
25-
export interface ICheckboxProps extends React.RefAttributes<HTMLDivElement> {
25+
export interface ICheckboxProps extends RefAttributes<HTMLDivElement> {
2626
/**
2727
* Optional callback to access the `ICheckbox` interface. Use this instead of `ref` for accessing
2828
* the public methods and properties of the component.

packages/react/src/components/ChoiceGroup/ChoiceGroup.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import type { IIconProps } from '../../Icon';
33
import type { IStyle, ITheme } from '../../Styling';
4-
import type { IRefObject, IRenderFunction, IStyleFunctionOrObject } from '../../Utilities';
4+
import type { IRefObject, IRenderFunction, IStyleFunctionOrObject, RefAttributes } from '../../Utilities';
55
import type {
66
IChoiceGroupOptionStyleProps,
77
IChoiceGroupOptionStyles,
@@ -28,7 +28,7 @@ export interface IChoiceGroup {
2828
*/
2929
export interface IChoiceGroupProps
3030
extends React.InputHTMLAttributes<HTMLElement | HTMLInputElement>,
31-
React.RefAttributes<HTMLDivElement> {
31+
RefAttributes<HTMLDivElement> {
3232
/**
3333
* Optional callback to access the `IChoiceGroup` interface. Use this instead of `ref` for accessing
3434
* the public methods and properties of the component.

packages/react/src/components/Coachmark/Beak/Beak.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as React from 'react';
21
import { RectangleEdge } from '../../../Positioning';
2+
import type { RefAttributes } from '../../../Utilities';
33

4-
export interface IBeakProps extends React.RefAttributes<HTMLDivElement> {
4+
export interface IBeakProps extends RefAttributes<HTMLDivElement> {
55
/**
66
* @deprecated Not used.
77
*/

packages/react/src/components/Coachmark/Coachmark.types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import type { IStyle, ITheme } from '../../Styling';
33
import type { IPositioningContainerProps } from './PositioningContainer/PositioningContainer.types';
4-
import type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';
4+
import type { IRefObject, IStyleFunctionOrObject, RefAttributes } from '../../Utilities';
55
import type { ITeachingBubble } from '../../TeachingBubble';
66
import type { Target } from '@fluentui/react-hooks';
77

@@ -19,7 +19,7 @@ export interface ICoachmark {
1919
* Coachmark component props
2020
* {@docCategory Coachmark}
2121
*/
22-
export interface ICoachmarkProps extends React.RefAttributes<HTMLDivElement> {
22+
export interface ICoachmarkProps extends RefAttributes<HTMLDivElement> {
2323
/**
2424
* Optional callback to access the `ICoachmark` interface. Use this instead of `ref` for accessing
2525
* the public methods and properties of the component.

packages/react/src/components/Coachmark/PositioningContainer/PositioningContainer.types.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { DirectionalHint } from '../../../common/DirectionalHint';
3-
import type { IRefObject, IBaseProps, Point, IRectangle } from '../../../Utilities';
3+
import type { IRefObject, IBaseProps, Point, IRectangle, RefAttributes } from '../../../Utilities';
44
import type { IPositionedData } from '../../../Positioning';
55
import type { Target } from '@fluentui/react-hooks';
66
import type { ILayerProps } from '../../../Layer';
@@ -13,9 +13,7 @@ export interface IPositioningContainer {}
1313
/**
1414
* {@docCategory Coachmark}
1515
*/
16-
export interface IPositioningContainerProps
17-
extends IBaseProps<IPositioningContainer>,
18-
React.RefAttributes<HTMLDivElement> {
16+
export interface IPositioningContainerProps extends IBaseProps<IPositioningContainer>, RefAttributes<HTMLDivElement> {
1917
/**
2018
* All props for your component are to be defined here.
2119
*/

0 commit comments

Comments
 (0)