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 };