Skip to content

react/jsx-no-duplicate-props Correctness ​

✅ This rule is turned on by default.

What it does ​

This rule prevents duplicate props in JSX elements.

Why is this bad? ​

Having duplicate props in a JSX element is most likely a mistake. Creating JSX elements with duplicate props can cause unexpected behavior in your application.

Example ​

Examples of incorrect code for this rule:

jsx
<App a a />;
<App foo={2} bar baz foo={3} />;

Examples of correct code for this rule:

jsx
<App a />;
<App bar baz foo={3} />;

References ​

Released under the MIT License.