React 无法识别 DOM 元素上的 `hasShow` 属性
React does not recognize the `hasShow` prop on a DOM element
反应管理员:3.8.4
我有一个简单的展示结构如下:
const OfferShow = (props) => {
return (
<Show component="div" title={<PageTitle text="Oferta" prop="title" />} {...props}>
<SimpleShowLayout>
</SimpleShowLayout>
</Show >
)
}
export default OfferShow;
如果我删除标签 <SimpleShowLayout>
我不会再看到此错误,如果我放置标签,错误是:
index.js:1 Warning: React does not recognize the `hasShow` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `hasshow` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
in div (created by ShowView)
in ShowView (created by Show)
in Show (at OfferShow.js:23)
in OfferShow (created by WithPermissions)
in WithPermissions (created by...
有没有人遇到过这个错误并可以帮助我?
您可以删除不需要的属性,例如 hasShow
并仍然使用这样的展开运算符:
const OfferShow = ({ hasShow, ...rest }) => {
return (
<Show component="div" title={<PageTitle text="Oferta" prop="title" />} {...rest}>
<SimpleShowLayout>
</SimpleShowLayout>
</Show >
)
}
export default OfferShow;
反应管理员:3.8.4
我有一个简单的展示结构如下:
const OfferShow = (props) => {
return (
<Show component="div" title={<PageTitle text="Oferta" prop="title" />} {...props}>
<SimpleShowLayout>
</SimpleShowLayout>
</Show >
)
}
export default OfferShow;
如果我删除标签 <SimpleShowLayout>
我不会再看到此错误,如果我放置标签,错误是:
index.js:1 Warning: React does not recognize the `hasShow` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `hasshow` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
in div (created by ShowView)
in ShowView (created by Show)
in Show (at OfferShow.js:23)
in OfferShow (created by WithPermissions)
in WithPermissions (created by...
有没有人遇到过这个错误并可以帮助我?
您可以删除不需要的属性,例如 hasShow
并仍然使用这样的展开运算符:
const OfferShow = ({ hasShow, ...rest }) => {
return (
<Show component="div" title={<PageTitle text="Oferta" prop="title" />} {...rest}>
<SimpleShowLayout>
</SimpleShowLayout>
</Show >
)
}
export default OfferShow;