From b842f949b7495946652855b7978d5c9f308a7f3c Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Tue, 30 Jan 2024 01:45:13 +0100 Subject: [PATCH] [core] `missingKeyGenerator` do no longer exist (#40830) Signed-off-by: Olivier Tassinari Co-authored-by: Marija Najdova --- packages/mui-base/src/useCompound/useCompoundItem.ts | 7 +++---- packages/mui-base/src/useCompound/useCompoundParent.ts | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/mui-base/src/useCompound/useCompoundItem.ts b/packages/mui-base/src/useCompound/useCompoundItem.ts index 6efa5a34a4ed1d..05f28a0d16e9e4 100644 --- a/packages/mui-base/src/useCompound/useCompoundItem.ts +++ b/packages/mui-base/src/useCompound/useCompoundItem.ts @@ -11,7 +11,7 @@ export interface UseCompoundItemReturnValue { /** * The unique key for the child component. * If the id was provided to `useCompoundItem`, this will be the same value. - * Otherwise, this will be a value generated by the `missingKeyGenerator`. + * Otherwise, this will be a value generated by the `id` function. */ id: Key | undefined; /** @@ -30,10 +30,9 @@ export interface UseCompoundItemReturnValue { * * @param id A unique key for the child component. If the `id` is `undefined`, the registration logic will not run (this can sometimes be the case during SSR). * This can be either a value, or a function that generates a value based on already registered siblings' ids. - * @param itemMetadata Arbitrary metadata to pass to the parent component. This should be a stable reference (e.g. a memoized object), to avoid unnecessary re-registrations. - * @param missingKeyGenerator A function that generates a unique id for the item. - * It is called with the set of the ids of all the items that have already been registered. + * If a function, it's called with the set of the ids of all the items that have already been registered. * Return `existingKeys.size` if you want to use the index of the new item as the id. + * @param itemMetadata Arbitrary metadata to pass to the parent component. This should be a stable reference (e.g. a memoized object), to avoid unnecessary re-registrations. * * @ignore - internal hook. */ diff --git a/packages/mui-base/src/useCompound/useCompoundParent.ts b/packages/mui-base/src/useCompound/useCompoundParent.ts index 61826f1e3392f2..61aa53700cc3bd 100644 --- a/packages/mui-base/src/useCompound/useCompoundParent.ts +++ b/packages/mui-base/src/useCompound/useCompoundParent.ts @@ -4,7 +4,6 @@ import * as React from 'react'; interface RegisterItemReturnValue { /** * The id of the item. - * If the `id` was `undefined`, an id from the `missingKeyGenerator` will be used. */ id: Key; /**