Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting this warning `No duplicate props allowed react/jsx-no-duplicate-props`

Tags:

react-redux

Why am I getting this warning?

warning No duplicate props allowed react/jsx-no-duplicate-props#

It's showing line number 28 but there is nothing props is using.

like image 244
Ramusesan Avatar asked Feb 21 '17 12:02

Ramusesan


People also ask

How do I pass JSX in props?

You want to use JSX inside your props You can simply use {} to cause JSX to parse the parameter. The only limitation is the same as for every JSX element: It must return only one root element.

What does props mean in JSX?

“Props” is a special keyword in React, which stands for properties and is being used for passing data from one component to another.

Is not defined React JSX no undef?

The React. js error "X is not defined react/jsx-no-undef" occurs when we forget to import a function, class or a variable in our code before using it. To solve the error, make sure to import the value before using it in your code, e.g. import {myFunc} from 'my-package' .


1 Answers

You probably passed the same prop twice to a Component. e.g.

<MyComponent someProp={'a'} someProp={'b'} /> 
like image 110
zyxue Avatar answered Sep 21 '22 08:09

zyxue