{"record":{"id":"7eb37cebf56b4f8a","repo":"heroui-inc/heroui","slug":"duplicate-collection-slot-name-use-a-unique","errorCode":null,"errorMessage":"Duplicate collection slot \"${name}\". Use a unique, namespaced name (e.g. \"tabs.listContainer\", \"menu.popover\").","messagePattern":"Duplicate collection slot \"(.+?)\"\\. Use a unique, namespaced name \\(e\\.g\\. \"tabs\\.listContainer\", \"menu\\.popover\"\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/react/src/utils/collection-prop-injection.tsx","lineNumber":30,"sourceCode":"let registry: Set<string> | undefined;\n\nconst __DEV__ = typeof process !== \"undefined\" && process.env?.[\"NODE_ENV\"] !== \"production\";\n\n/**\n * Create a CollectionBuilder-safe slot for optional chrome around a RAC collection\n * target (e.g. TabList, ListBox).\n *\n * The injector emits no host DOM: chrome props are provided via Context and a\n * string-keyed `cloneElement` channel (React strips Symbol keys from element props).\n * The target should apply chrome through the RAC `render` prop — not by wrapping\n * the collection child in a host node.\n */\nexport const createCollectionSlot = <T extends object>(name: string) => {\n  if (__DEV__) {\n    registry ??= new Set<string>();\n\n    if (registry.has(name)) {\n      logger.warn(\n        `Duplicate collection slot \"${name}\". Use a unique, namespaced name (e.g. \"tabs.listContainer\", \"menu.popover\").`,\n      );\n    }\n\n    registry.add(name);\n  }\n\n  // String key required — React drops Symbol keys from element props / cloneElement.\n  const key = `$$heroui.collection.${name}`;\n  const SlotContext = createContext<T | undefined>(undefined);\n\n  const inject = (children: ReactNode, value: T): ReactNode => {\n    return Children.map(children, (child) => {\n      if (!isValidElement(child)) {\n        return child;\n      }\n\n      return React.cloneElement(child as ReactElement<Record<string, unknown>>, {","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/heroui-inc/heroui/blob/7546fff8136f538a2f56a52257c621a5cd616a1d/packages/react/src/utils/collection-prop-injection.tsx#L12-L48","documentation":"HeroUI registers collection slot names (used to inject collection props into arbitrary components) in a dev-only registry. If two different call sites create a collection slot with the same name, the library warns about duplicates to catch collisions where one slot could overwrite another's injected props. The name is still registered/used; it is a diagnostic warning in development only.","triggerScenarios":"Calling createCollectionSlot(\"listContainer\") from two different components, or using an unnamespaced generic name like \"container\" in more than one place; only fires when __DEV__ is true.","commonSituations":"Contributing a new component that uses createCollectionSlot with a name already taken by another component; using generic slot names like \"base\" or \"item\" instead of namespaced ones.","solutions":["Rename the slot to a unique namespaced name like \"<component>.<slot>\" (e.g. \"tabs.listContainer\", \"menu.popover\")","Search the repo for the existing createCollectionSlot call with that name and pick a different one","Follow the established naming convention when adding new collection slots"],"exampleFix":"// before\nexport const ListContainerSlot = createCollectionSlot(\"listContainer\");\n\n// after\nexport const ListContainerSlot = createCollectionSlot(\"tabs.listContainer\");","handlingStrategy":"validation","validationCode":"// Before registering, check uniqueness across your codebase:\n// grep -r \"createCollectionSlot(\" packages/\n// Use namespaced names: `${componentName}.${slotName}`","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always namespace slot names as component.slot","Grep for existing names before adding a new collection slot","Treat this warning as a CI signal to rename before shipping"],"tags":["dev-warning","duplicate-key","collection","slots","internal"],"backgroundTag":"duplicate-slot-name-warning","analyzedSha":"7546fff8136f538a2f56a52257c621a5cd616a1d","analyzedAt":"2026-08-28T13:15:49.959Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}