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

Add support for functions as content #106

Closed
giocodes opened this issue Dec 17, 2017 · 3 comments
Closed

Add support for functions as content #106

giocodes opened this issue Dec 17, 2017 · 3 comments
Assignees

Comments

@giocodes
Copy link

Hello! First of all, THANK YOU this is a great library. 👏 X1000
I want to suggest adding support for functions as content. Example:

toast(({ closeToast }) =>
  <div>
    <p onClick={handlerX}>Do something</p>
    <p onClick={closeToast}>Close</p>
  </div>
);

I believe this currently returns nothing.

@giocodes giocodes changed the title Add support for functions as content (arrow functions) Add support for functions as content Dec 17, 2017
@fkhadra fkhadra self-assigned this Dec 17, 2017
@fkhadra
Copy link
Owner

fkhadra commented Dec 17, 2017

Hello @giocodes,

Glad you like it.

When you call the toast function it returns a toastId. That one can be used to dismiss or to update the toast.

Anyway, I will probably allow this pattern in the next release. I'll let you know as soon as it's available.

fkhadra added a commit that referenced this issue Dec 17, 2017
@fkhadra
Copy link
Owner

fkhadra commented Dec 21, 2017

Feature released.

@fkhadra fkhadra closed this as completed Dec 21, 2017
@giocodes
Copy link
Author

Awesome! Thanks

vasiliydolmatov pushed a commit to vasiliydolmatov/react-toastify that referenced this issue Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants