You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when users clicking over button multiple times very quickly multiple instances of same modal gets created.
One way I can fix this by using event throttle when calling the open modal. I feel App becomes slow when modal content is more. So users pressed the modal open buttons multiple times as a results multiple instances of modal gets created.
When using Modal component shipped with React Native, It always stays in DOM and accepts the prop visible to be true or false. So it feels faster.
But I think when using this library. You Modal Component gets added to DOM only when openModal is called.
Can we make modal opening little bit more performant?
The text was updated successfully, but these errors were encountered:
Regarding your 1st comment: Modalfy purposefully does not manage how many times a modal is being opened. It is actually in our philosophy to let you:
Display several modals at once, stack as many as you like.
That's why you indeed are the one responsible for debouncing the actions that lead to a modal opening.
Regarding your 2nd comment, this is a tradeoff we have to pay for using a JavaScript solution. As you may already know, React Native's Modal uses a nativemodal View under the hood. The clear advantage there is the one you mentioned: speed. The drawback - that was also a motivation for use to create Modalfy - is that: it doesn't allow you to have multiple modals at once. Those 2 things combined make it much easier to use a single Modal and just have to update its content.
But because Modalfy doesn't know which and how many modals you'll be opening and closing, the same approach wouldn't really be a viable option for us.
However, if you already have ideas about how to make opening modals more performant: I'll be more than happy to review any PR you'd submit!
When using Modal component shipped with React Native, It always stays in DOM and accepts the prop visible to be true or false. So it feels faster.
But I think when using this library. You Modal Component gets added to DOM only when openModal is called.
Can we make modal opening little bit more performant?
The text was updated successfully, but these errors were encountered: