Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show Toast programmatically? #79

Open
gino8080 opened this issue May 28, 2019 · 0 comments
Open

How to show Toast programmatically? #79

gino8080 opened this issue May 28, 2019 · 0 comments

Comments

@gino8080
Copy link

gino8080 commented May 28, 2019

I need a way to call and show Toast notifications by code, i mean something like the ant design notification
https://ant.design/components/notification/

import { Button, notification } from 'antd';

const openNotification = () => {
  notification.open({
    message: 'Notification Title',
    description:
      'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
    onClick: () => {
      console.log('Notification Clicked!');
    },
  });
};

ReactDOM.render(
  <Button type="primary" onClick={openNotification}>
    Open the notification box
  </Button>,
  mountNode,
);

so I don't have to create che html , and i can show as many as Toast i need
it is possible ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant