Skip to main content

Duplicate IDs

IDs must be unique in the DOM.

See this on your site

Step-by-step fixes by platform

Programmatic guides combine the issue explanation with stack-specific notes and examples where we have them.

Fix

Rename duplicates; generate stable unique ids for lists rendered in loops.

Examples

  • Two `id="email"` fields after copying a form block.
  • Accordion headers generated in a loop with static ids.

How to fix

Ensure ids are unique per document; generate stable unique ids in lists.

Fix templates so duplicated components do not reuse hard-coded ids.

Platform notes

React
Use useId (React 18+) for generated ids in loops.

Related: 4.1.1 Parsing (historically); best practice for robustness.