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

Different toast position in a single component #84

Open
vishgoel007 opened this issue Sep 23, 2019 · 1 comment
Open

Different toast position in a single component #84

vishgoel007 opened this issue Sep 23, 2019 · 1 comment

Comments

@vishgoel007
Copy link

Currently in a component we can show toast only at a single position. What i wanted to do is show some toast at top and some at centre. Similarly for background color, we can't set different background colors for different toasts in a component.

@RogerKikkas
Copy link

You can create multiple Toasts in a component with different refs.
So something like this.

<Toast ref={this.successToast} position="top" style={{ backgroundColor: 'green' }} />
<Toast ref={this.errorToast} position="center" style={{ backgroundColor: 'red' }} />

In the constructor you create refs (this.successToast = React.createRef()) for both of them and then call the ref that you want to show.

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

2 participants