sweetalert2 / sweetalert2-react-content

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

Sweetalert2 launches as a top level component - instead of being a child component of his parent. #105

Closed MichaelBrauner closed 4 years ago

MichaelBrauner commented 4 years ago

I used sweetalert2-react-content - all works well and is super customizable. The only issue I have is, the content of the swal2 popup will never update on state changes because it launches as a top-level component beneath the regular app component. So state changes don't affect it.

Is there a way to change this behavior? Or is there a possibility that in a future version of this nice sweetalert2 enhancer it will be rendered as a child of the component wich created it?

Thanks Michael

zenflow commented 4 years ago

@Slowwie This issue seems to be very confused..

Regarding the title: Sweetalert2 is not a top level component; it's not a [React] component at all. Therefore it can't have a parent component or be a child component. Is this issue meant for a different repo? (Like https://github.com/alex-shamshurin/sweetalert2-react?)

Regarding the first paragraph: Stateful components seem to work fine. See https://puffy-agenda.glitch.me/. The React content will update on state changes.

If you think there really is an issue here, please

... and I will reopen