Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] missingKeyGenerator do no longer exist #40830

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/mui-base/src/useCompound/useCompoundItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface UseCompoundItemReturnValue<Key> {
/**
* 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;
/**
Expand All @@ -30,10 +30,9 @@ export interface UseCompoundItemReturnValue<Key> {
*
* @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 functio, it's called with the set of the ids of all the items that have already been registered.
oliviertassinari marked this conversation as resolved.
Show resolved Hide resolved
* 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.
*/
Expand Down
1 change: 0 additions & 1 deletion packages/mui-base/src/useCompound/useCompoundParent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import * as React from 'react';
interface RegisterItemReturnValue<Key> {
/**
* The id of the item.
* If the `id` was `undefined`, an id from the `missingKeyGenerator` will be used.
*/
id: Key;
/**
Expand Down
Loading