DEV Community

Discussion on: Create a Simple 0-dependency Toast (part 2) - Class-based

Collapse
 
js2me profile image
Sergey S. Volkov

Thanks, will add this to my site, but add a small integration with React :)

Collapse
 
tsanak profile image
tsanak

Thank you for your comment!

I tried for like an hour to convert this to a React component, but the problem is that I don't know React 😅 !
Then I tried to think at it from a Vue standpoint and I realized that while it is very feasible, it would take away the fun of just writing:

new Toast("✔️ This is a dismissable toast without timer! 👏", {
    dismiss: true,
    alwaysOn: true
});

You can find the hackiest solution to use the Toast Class in React in the codepen below:

please don't judge me on that code 😂😂