gpt4 book ai didi

javascript - JS 草案 - 提及 - 插件产生此 : Warning: React does not recognize the isFocused prop on a DOM element

转载 作者:行者123 更新时间:2023-11-28 03:56:18 27 4
gpt4 key购买 nike

在将 Draft-js-mention-plugin 纳入我的应用程序时,我遇到了问题。请看一下:

"Warning: React does not recognize the isFocused prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase isfocused instead. If you accidentally passed it from a parent component, remove it from the DOM element."

请根据这个问题找到打印屏幕:

enter image description here

顺便说一句,这个问题也可以在这个例子中找到:https://codesandbox.io/s/x2r59zo4j4

有人有同样的警告吗?!或者有人在reactjs中使用draftjs,甚至在vanilla javascript中提到过?我只需要依靠一个例子来完成任务(我是 JS、React JS 的新手)...提前致谢:)!

最佳答案

也许原因是因为在你的组件中你声明了

const { blabla, foo, bar} = this.props

在你的渲染中:

<Component 
blabla={blabla}
foo={foo}
bar={bar}
{...this.props} />

React 会解释您传递了两次 props 并在控制台中向您发出警告

关于javascript - JS 草案 - 提及 - 插件产生此 : Warning: React does not recognize the isFocused prop on a DOM element,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47515087/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com