Closed plckr closed 2 years ago
You may need use a separate state for such cases:
const [pending, setPending] = useState(false);
const showModal = () => {
setPending(true);
modal.show(MyModal, {}).then(() => {
setPending(false);
}
}
Or, you just handle pending state inside a modal.
This is the solution I first remembered. But thought you wanted to implement inside the library. In that case this issue can be closed 👍
Hello once again,
Looking at the documentation I could not find the answer. I'm trying to implement a loading inside my modal, after the user submits (resolves, or rejects the promise)
For that, I thought about know if the Promise is Pending or Resolves/Rejected if Resolves/rejected the loading should appear
I suggest add a isPending property for example
Example code after the implementation