1

I tried including a Info Icon from mui in md toast, but it didn't work. This is what I tried:

import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
toast("Information Toast", {
icon: <InfoOutlinedIcon />,
autoClose: false,
});

And it throws me an error for not being able to read properties of undefined. I saw that you can include it inside the message, but if I write a longer message it no longer aligns with the icon. That's why I wanted to try it this way.

Does someone know another way, I can use a custom Icon from mui in my toast?

FishyK
  • 121
  • 1
  • 7
  • 1
    Can you add the whole code? I tried it and it worked fine, like this: https://codesandbox.io/s/suspicious-heyrovsky-8yvyxi?file=/src/App.js – S.Marx Dec 15 '22 at 11:31
  • 1
    I noticed, that I used an old version of the icon pack/toastify package. Updating solved it :) – FishyK Jan 04 '23 at 11:03

0 Answers0