nice-modal-react
nice-modal-react copied to clipboard
Add ability to resolve/reject and hide
Hey team,
Loving the library and I found that I often would call resolve and hide or reject and hide, and noticed that there was a similar pattern mentioned in #88
This would mean that users are able to do something like:
const {resolveAndHide} = useModal()
return (
<Modal onClose={() => resolveAndHide(false)}>
<p>Content</p>
</Modal>
)
Happy to update with any feedback
Reason for creating new methods was to keep backwards compatibility