为什么我会收到此警告“不允许重复道具 react/jsx-no-duplicate-props" [英] Why am I getting this warning `No duplicate props allowed react/jsx-no-duplicate-props`

查看:55
本文介绍了为什么我会收到此警告“不允许重复道具 react/jsx-no-duplicate-props"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我会收到此警告?

Why am I getting this warning?

warning 不允许重复的 props react/jsx-no-duplicate-props#

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

它显示了第 28 行,但没有使用 props.

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

推荐答案

您可能两次将同一个 prop 传递给一个组件.例如

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

<MyComponent someProp={'a'} someProp={'b'} />

这篇关于为什么我会收到此警告“不允许重复道具 react/jsx-no-duplicate-props"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆