更新我的 React/Next.js 应用程序后,我收到此错误:
React 无法识别 DOM 元素上的
属性。如果您有意希望它作为自定义属性出现在 DOM 中,请将其拼写为小写isDisabled
。如果您不小心从父组件传递了它,请将其从 DOM 元素中删除。isdisabled
这就是我使用该img的方式:
<img src={user?.photoURL ? user?.photoURL : "https://xxxxxxx"} alt="avatar" className="w-8 h-8 rounded-full border-2 border-violet-600 cursor-pointer" />
如果我删除
<img>
并将其替换为 a,那么 <span>
错误就消失了。
React 不支持 isDisabled 属性,请尝试使用 disabled 属性,如下所示:
<img disabled={true} src={user?.photoURL ? user?.photoURL : "https://xxxxxxx"} alt="avatar" className="w-8 h-8 rounded-full border-2 border-violet-600 cursor-pointer" />