-
-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize modal component when programmatically invoked #17001
Comments
It's not a good place to set customize component with Modal.xxx. It's a simple function an will not provide much customize component support. You can make your own Modal static function instead. |
Yes this is how I initially wanted to approach it, but looking at the source code I've noticed that static function doesn't re-use code of Modal's component, so making my own static function is not very trivia unless I just copy/paste That's why I thought it'd be a nice opportunity to refactor modal component a bit, make it more Perhaps I'm missing something, but is there a way to wrap programmatically invoked Modal with my own custom component? |
Modal.xxx internal wrap a In this case, yes, you may to code your static function own. You can copy full of the code or part of it or realize with own logic. |
Ok, thanks for getting back to me and your clarifications |
What problem does this feature solve?
In our application, we've created a couple of custom components as a wrapper on top of the
Modal
, with different styles and slightly enhanced API. We're facing a scenario where we need to programmatically invoke different types of Modals (likeModal.error()
). Unfortunately, the is no convenient way to specify a custom component which we've created earlier.What does the proposed API look like?
The way I see it is that a new option can be added to
#Modal.method()
config, something likeModal.error({ component: MyCustomErrorModal })
. Make this flag optional or even add a new method, something likeModal.custom()
.The text was updated successfully, but these errors were encountered: