React-toastify: Add support for functions as content

Created on 17 Dec 2017  路  3Comments  路  Source: fkhadra/react-toastify

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.

feature

Most helpful comment

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.

All 3 comments

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.

Feature released.

Awesome! Thanks

Was this page helpful?
0 / 5 - 0 ratings