Programmatically Close Dialog #1504
Answered
by
joaom00
ColeMiller21
asked this question in
Q&A
-
I have a dialog that will save changes - but I want it to close if the submit method is called successfully and unsure on how to accomplish this? |
Beta Was this translation helpful? Give feedback.
Answered by
joaom00
Sep 11, 2023
Replies: 2 comments 2 replies
-
To control the Dialog you can do this const [open, setOpen] = React.useState(false)
<Dialog open={open} onOpenChange={setOpen}>
...
</Dialog> |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ColeMiller21
-
you can use react useRef hook.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To control the Dialog you can do this