Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { React, useRef } from 'react';
- import NotificationAlert from 'react-notification-alert';
- import {Card, Row, Col, Button} from "reactstrap";
- var options = {}
- options = {
- place: 'br',
- message: (
- <div>
- <div>
- Welcome to <b>Now UI Dashboard React</b> - a beautiful freebie for every web developer.
- </div>
- </div>
- ),
- type: "success",
- icon: "fa fa-user",
- autoDismiss: 7
- }
- function App() {
- const refOptions = useRef(null)
- const myFunc = () => {
- refOptions.current.notificationAlert(options);
- }
- return (
- <div className="content">
- <Row>
- <Col md="12">
- <Card className="card text-center">
- <NotificationAlert ref={refOptions} />
- <Button onClick={myFunc}>Hey</Button>
- </Card>
- </Col>
- </Row>
- </div>
- );
- }
- export default App;
Advertisement
Add Comment
Please, Sign In to add comment