Passing the close function from Dialog to the Modal component #4707
-
I’m using the SlideUpModal component which requires an onClose prop. However, I can only access the close function inside the Dialog component which needs to be nested under the Modal. How can I pass the close function from the Dialog to the onClose prop of the SlideUpModal component?
In this example, we need to pass the close function from the Dialog to the onClose prop of the SlideUpModal, but it’s not clear how to do that. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I'm not sure what the SlideUpModal component is, so it may be useful to post a codesandbox to give some additional context. Maybe you can consider making it controlled instead? |
Beta Was this translation helpful? Give feedback.
-
my issue had been resolved check the comments on the post for further details. |
Beta Was this translation helpful? Give feedback.
Couple other things to try, you could look at our nightlies for this functionality #4684
You could also try inverting the order and wrap the
SlideUpModal
inside theDialog