timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.84k stars 331 forks source link

Toasts from array of objects #235

Closed andresyapp closed 2 years ago

andresyapp commented 2 years ago

Hello there! how can I display toasts by traversing an array of objects, each of these objects with a unique id and names. I need to display a toast for each object inside this array, with a text and the value {item.name}.

In this example I used the usetoaster base and added the array of objects as an example, in that example there is a button that launches a toast, I need to press that button and it displays a toast for each object inside the array.

I tried several ways and I was unsuccessful. https://codesandbox.io/s/react-hot-toast-usetoaster-headless-example-forked-s37p3b?file=/src/App.js