ecronix/react-most-wanted

No handler on dialog close/open

harm-meijer opened this issue · 2 comments

useQuestions gives me openDialog, closeDialog and setProcessing. How do I give the dialog an onClose handler?

The handleAction gives you an handleClose as parameter:

handleAction: (handleClose) => {
              setProcessing(true)
              console.log('Doing some async stuff')

              setTimeout(() => {
                console.log('finished async stuff')
                //Do some stuff and then
                handleClose()
              }, 3000)
            },