I am working on a react application and want to implement react-notifications-component for notifications. I don't know how to call it's addNotification method from every component.
如果你想在另一个组件中调用一个组件的函数,你必须通过props
传递对它的引用。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.