Skip to content

Commit

Permalink
fix: call super method /w given arg when extending onOpen & onClose (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zenflow authored and Limon Monte committed Nov 8, 2019
1 parent 5c04177 commit 4362bdc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 4362bdc

Please sign in to comment.