首页 > 解决方案 > “React 无法识别 DOM 元素上的 `classsName` 属性”

问题描述

我正在开发一个 React 应用程序并不断遇到我不理解的错误。我在其他任何地方都找不到。我的理解是,在 JSX 元素中,我应该始终使用“className”而不是“class”属性。但是,我收到了这个警告:

index.js:2178 Warning: React does not recognize the `classsName` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `classsname` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

有人以前见过这个或知道我做错了什么吗?

标签: reactjs

解决方案


推荐阅读