小编Art*_*m S的帖子

反应管理中的 showNotification 不起作用

1. 从生命周期回调中调用。 我有如下代码:

// app.js
<Admin>
   <Resource name="FooList" list={FooList} />
</Admin>

// FooList.js
class FooList extends React.Component {
     componentDidMount () {
         showNotification("foo")
     }
}

export default connect(null, {showNotification})(FooList)
Run Code Online (Sandbox Code Playgroud)

当组件安装时,控制台出现错误:

 Warning: React does not recognize the `showNotification` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `shownotification` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
Run Code Online (Sandbox Code Playgroud)

2. 调用某个事件(例如点击)。在其他情况下,我有一些处理程序并调用showNotification …

reactjs react-redux react-admin

3
推荐指数
1
解决办法
4029
查看次数

标签 统计

react-admin ×1

react-redux ×1

reactjs ×1