Open PawelStadnicki opened 2 years ago
Hello,
I don't think it can work because Feliz don't expect an Elmish program with a view because it doesn't offer a clean way to attach the view.
I guess you could pass a program with a Program.withReact
instruction but it would feel dirty to mount a react application inside of a react app.
I think React portal are a way to fix it but I don't know if this will require fixes from Feliz too or just Thoth.Elmish.Toast.
In React world there is https://www.npmjs.com/package/react-toastify which seems to offer something equivalent but using Hooks API instead.
There is also https://react-hot-toast.com/ which is smaller if bundle size is important to you.
In standard Elmish, Toast requires "registration" in the program entity:
I wonder if it is possible to use this library along with Feliz hooks . It still will be command on Update:
but I have no idea where the registration part should happen. I'm not asking how to do it, expecting implementation changes required, just checking if this is feasible and with what effort.