Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
7 contributors

Users who have contributed to this file

@bmish @ljharb @yannickcr @lencioni @felicio @Adzz @adnasa

Disallow duplicate properties in JSX (react/jsx-no-duplicate-props)

💼 This rule is enabled in the ☑️ recommended config.

Creating JSX elements with duplicate props can cause unexpected behavior in your application.

Rule Details

Examples of incorrect code for this rule:

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

Examples of correct code for this rule:

<Hello firstname="John" lastname="Doe" />;

Rule Options

...
"react/jsx-no-duplicate-props": [<enabled>, { "ignoreCase": <boolean> }]
...

ignoreCase

When true the rule ignores the case of the props. Default to false.

When Not To Use It

If you are not using JSX then you can disable this rule.