sweetalert2 / sweetalert2-react-content

Official SweetAlert2 enhancer adding support for React elements as content
MIT License
703 stars 48 forks source link

Passing react elements via `.mixin` doesn't work #152

Closed zenflow closed 3 years ago

zenflow commented 3 years ago

Before sweetalert2 v10.12.4 / PR https://github.com/sweetalert2/sweetalert2/pull/2133 you could pass react elements via .mixin and they would be rendered. After that change they are not rendered.

See incoming PR with failing test to demonstrate issue

This regression is due to this change of the API of the extendable _main method: https://github.com/sweetalert2/sweetalert2/pull/2133/files#diff-24b19ba280de0eb7ac71d7f82c2b44d2456d6ecd0823196bd5e7894c6f71f2db

That change could be integrated here (in this package) but I think instead we should reverse it. Users intuitively expect each param to have the same effect regardless of whether it is passed via .mixin or .fire, so what is the point of keeping them separate? This added complexity can also be confusing.

BarAppTeam commented 3 years ago

Is there anything new in the subject? The fault has been open for over a month and there are no answers from the developer

n3s7or commented 3 years ago

In my case the mixin feature has gone away, configutations are not getting applied when using .mixin. Is there any workaround for this?

zenflow commented 3 years ago

Only workaround I can think of at the moment is to roll back your sweetalert2 package version to 10.12.3 (the version just before PR https://github.com/sweetalert2/sweetalert2/pull/2133 was merged).

This is really an issue in sweetalert2, not in this package, so you might want to follow this issue too: https://github.com/sweetalert2/sweetalert2/issues/2177

limonte commented 3 years ago

Fixed by #153