logoESLint React
Rules

jsx-no-duplicate-props

Disallows duplicate props in JSX elements.

Full Name in eslint-plugin-react-x

react-x/jsx-no-duplicate-props

Full Name in @eslint-react/eslint-plugin

@eslint-react/jsx-no-duplicate-props

Presets

x recommended strict

Rule Details

Passing the same prop twice in a JSX element will cause the second value to overwrite the first. This is usually a mistake and can lead to unexpected behavior.

Common Violations

Invalid

<Hello name="John" name="Doe" />;

Valid

<Hello name="John" />;

Resources

Further Reading


See Also

On this page