File tree Expand file tree Collapse file tree
apps/www/src/content/docs/components/breadcrumb
packages/raystack/components/breadcrumb Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ export interface BreadcrumbItem {
2222 * When `dropdownItems` is provided, the `as` and `href` props are ignored.
2323 */
2424 dropdownItems ?: {
25+ /** Optional stable key for list reconciliation. Falls back to index if omitted. */
26+ key ?: string ;
2527 /** Text to display for the dropdown item */
2628 label : string ;
2729 /** Callback function when a dropdown item is clicked */
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import { Menu } from '../menu';
1313import styles from './breadcrumb.module.css' ;
1414
1515export interface BreadcrumbDropdownItem {
16+ /** Optional stable key for list reconciliation (use when items can reorder). Falls back to index if omitted. */
17+ key ?: string ;
1618 label : string ;
1719 onClick ?: React . MouseEventHandler < HTMLElement > ;
1820}
@@ -62,7 +64,7 @@ export const BreadcrumbItem = forwardRef<
6264 < Menu . Content className = { styles [ 'breadcrumb-dropdown-content' ] } >
6365 { dropdownItems . map ( ( dropdownItem , dropdownIndex ) => (
6466 < Menu . Item
65- key = { dropdownIndex }
67+ key = { dropdownItem . key ?? dropdownIndex }
6668 className = { styles [ 'breadcrumb-dropdown-item' ] }
6769 onClick = { dropdownItem ?. onClick }
6870 >
You can’t perform that action at this time.
0 commit comments