Skip to content

Commit 55de57f

Browse files
bsunderhusmainframev
authored andcommitted
chore: deprecates ComponentState.components property
1 parent 54cd2f0 commit 55de57f

File tree

21 files changed

+65
-15
lines changed

21 files changed

+65
-15
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "chore: deprecates ComponentState.components property",
4+
"packageName": "@fluentui/react-drawer",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "chore: deprecates ComponentState.components property",
4+
"packageName": "@fluentui/react-search",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "chore: deprecates ComponentState.components property",
4+
"packageName": "@fluentui/react-tag-picker",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "chore: deprecates ComponentState.components property",
4+
"packageName": "@fluentui/react-virtualizer",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-drawer/library/src/components/DrawerHeaderTitle/useDrawerHeaderTitleStyles.styles.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export const useDrawerHeaderTitleStyles_unstable = (state: DrawerHeaderTitleStat
3535

3636
const styles = useStyles();
3737

38+
// We should not use components to pass along the base element type of a slot
39+
// but there's no way to retrieve the element type of a slot from the slot definition
40+
// right now without using SLOT_ELEMENT_TYPE_SYMBOL
41+
// TODO: create a method to retrieve the element type of a slot
42+
// eslint-disable-next-line deprecation/deprecation
3843
const { heading: root = {}, action, components } = state;
3944

4045
useDialogTitleStyles_unstable({

packages/react-components/react-jsx-runtime/src/createElement.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ describe('createElement with getSlotsNext', () => {
7070
describe('custom behavior tests', () => {
7171
it('keeps children from "defaultProps" in a render callback', () => {
7272
type TestComponentSlots = { slot: Slot<'div'> };
73-
// eslint-disable-next-line deprecation/deprecation
7473
type TestComponentState = ComponentState<TestComponentSlots>;
7574
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
7675

@@ -114,7 +113,6 @@ describe('createElement with getSlotsNext', () => {
114113

115114
it('keeps children from a render template in a render callback', () => {
116115
type TestComponentSlots = { outer: Slot<'div'>; inner: Slot<'div'> };
117-
// eslint-disable-next-line deprecation/deprecation
118116
type TestComponentState = ComponentState<TestComponentSlots>;
119117
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
120118

packages/react-components/react-jsx-runtime/src/interop.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ describe('resolveShorthand with assertSlots', () => {
1414
someSlot: NonNullable<Slot<'div'>>;
1515
};
1616
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
17-
// eslint-disable-next-line deprecation/deprecation
1817
type TestComponentState = ComponentState<TestComponentSlots>;
1918

2019
const TestComponent = (props: TestComponentProps) => {
@@ -59,7 +58,6 @@ describe('resolveShorthand with assertSlots', () => {
5958
it('keeps children from a render template in a render callback', () => {
6059
const consoleWarnMock = jest.spyOn(console, 'warn').mockImplementation();
6160
type TestComponentSlots = { outer: NonNullable<Slot<'div'>>; inner: NonNullable<Slot<'div'>> };
62-
// eslint-disable-next-line deprecation/deprecation
6361
type TestComponentState = ComponentState<TestComponentSlots>;
6462
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
6563

@@ -121,7 +119,6 @@ describe('resolveShorthand with assertSlots', () => {
121119
it("should support 'as' property to opt-out of base element type", () => {
122120
const consoleWarnMock = jest.spyOn(console, 'warn').mockImplementation();
123121
type TestComponentSlots = { slot: NonNullable<Slot<'div', 'span'>> };
124-
// eslint-disable-next-line deprecation/deprecation
125122
type TestComponentState = ComponentState<TestComponentSlots>;
126123
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
127124

@@ -174,6 +171,7 @@ describe('resolveShorthand with assertSlots', () => {
174171
const TestComponent = (props: TestComponentProps) => {
175172
const higherOrderState = useHigherOrderStateHook(props);
176173
const state: TestComponentState = {
174+
// eslint-disable-next-line deprecation/deprecation
177175
components: { ...higherOrderState.components, slot: 'span' },
178176
slot: {
179177
...higherOrderState.slot,

packages/react-components/react-jsx-runtime/src/jsx-runtime.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ describe('createElement with getSlotsNext', () => {
6464
describe('custom behavior tests', () => {
6565
it('keeps children from "defaultProps" in a render callback', () => {
6666
type TestComponentSlots = { slot: Slot<'div'> };
67-
// eslint-disable-next-line deprecation/deprecation
6867
type TestComponentState = ComponentState<TestComponentSlots>;
6968
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
7069

@@ -108,7 +107,6 @@ describe('createElement with getSlotsNext', () => {
108107

109108
it('keeps children from a render template in a render callback', () => {
110109
type TestComponentSlots = { outer: Slot<'div'>; inner: Slot<'div'> };
111-
// eslint-disable-next-line deprecation/deprecation
112110
type TestComponentState = ComponentState<TestComponentSlots>;
113111
type TestComponentProps = ComponentProps<Partial<TestComponentSlots>>;
114112

packages/react-components/react-menu/library/src/components/MenuItemLink/useMenuItemLink.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export const useMenuItemLink_unstable = (
2727
return {
2828
...baseState,
2929
components: {
30+
// eslint-disable-next-line deprecation/deprecation
3031
...baseState.components,
3132
root: 'a',
3233
},

packages/react-components/react-menu/library/src/components/MenuItemSwitch/useMenuItemSwitch.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const useMenuItemSwitch_unstable = (
2929
},
3030
}),
3131
components: {
32+
// eslint-disable-next-line deprecation/deprecation
3233
...baseState.components,
3334
switchIndicator: 'span',
3435
},

0 commit comments

Comments
 (0)