From e048761d39d0e11d7607be95647bd069a7fcac7c Mon Sep 17 00:00:00 2001 From: Gururaj J <89023023+Gururajj77@users.noreply.github.com> Date: Thu, 23 May 2024 20:38:49 +0530 Subject: [PATCH] fix: deprecated containedlist.containedlistitem (#16552) --- .../components/ContainedList/__tests__/ContainedList-test.js | 1 + packages/react/src/components/ContainedList/index.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/react/src/components/ContainedList/__tests__/ContainedList-test.js b/packages/react/src/components/ContainedList/__tests__/ContainedList-test.js index 7c5938942112..8b7b0de6c0b0 100644 --- a/packages/react/src/components/ContainedList/__tests__/ContainedList-test.js +++ b/packages/react/src/components/ContainedList/__tests__/ContainedList-test.js @@ -44,6 +44,7 @@ function TestComponent({ list, item }) { beforeEach(() => { // eslint-disable-next-line testing-library/no-render-in-lifecycle + jest.mock('../../../internal/deprecateFieldOnObject'); wrapper = render(); }); diff --git a/packages/react/src/components/ContainedList/index.ts b/packages/react/src/components/ContainedList/index.ts index 8a6eacee52fa..6260e9f02ef7 100644 --- a/packages/react/src/components/ContainedList/index.ts +++ b/packages/react/src/components/ContainedList/index.ts @@ -5,11 +5,15 @@ * LICENSE file in the root directory of this source tree. */ +import { deprecateFieldOnObject } from '../../internal/deprecateFieldOnObject'; import ContainedList from './ContainedList'; import ContainedListItem from './ContainedListItem'; ContainedList.ContainedListItem = ContainedListItem; +if (__DEV__) { + deprecateFieldOnObject(ContainedList, 'ContainedListItem', ContainedListItem); +} export { ContainedListItem }; export default ContainedList; export { ContainedList };