UNPKG

react-notifications-component-updated

Version:
3 lines (2 loc) 1.12 kB
export declare const install = "npm install react-notifications-component"; export declare const usage = "import React from \"react\";\nimport ReactNotification from \"react-notifications-component\";\n\nclass App extends React.Component {\n constructor(props) {\n super(props);\n this.addNotification = this.addNotification.bind(this);\n this.notificationDOMRef = React.createRef();\n }\n\n addNotification() {\n this.notificationDOMRef.current.addNotification({\n title: \"Awesomeness\",\n message: \"Awesome Notifications!\",\n type: \"success\",\n insert: \"top\",\n container: \"top-right\",\n animationIn: [\"animate__animated\", \"animate__fadeIn\"],\n animationOut: [\"animate__animated\", \"animate__fadeOut\"],\n dismiss: { duration: 2000 }\n });\n }\n\n render() {\n return (\n <div className=\"app-content\">\n <ReactNotification ref={this.notificationDOMRef} />\n <button onClick={this.addNotification} className=\"btn btn-primary\">\n Add Awesome Notification\n </button>\n </div>\n );\n }\n}";