From 0fa5a4432e914605110d5961f24210eb6391cf55 Mon Sep 17 00:00:00 2001 From: Matthew Francis Brunetti Date: Fri, 8 Nov 2019 19:14:20 +0100 Subject: [PATCH] Call super method /w given arg when extending onOpen & onClose, fixes #100 --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index d7d37fe..5d6057c 100644 --- a/src/index.js +++ b/src/index.js @@ -35,15 +35,15 @@ export default function withReactContent (ParentSwal) { let domElement const superOnOpen = params.onOpen - params.onOpen = () => { + params.onOpen = (element) => { domElement = getter(ParentSwal) ReactDOM.render(reactElement, domElement) - superOnOpen() + superOnOpen(element) } const superOnClose = params.onClose - params.onClose = () => { - superOnClose() + params.onClose = (element) => { + superOnClose(element) ReactDOM.unmountComponentAtNode(domElement) } }