Skip to main content
When a view has run its course, dismissing it hands the user back to the conversation instead of leaving a spent panel on screen. useRequestClose asks the host to do that; the host owns the decision.

Example

After the order is placed, a “Done” button dismisses the confirmation and hands the shopper back to the conversation.

Returns

useRequestClose returns a single function.

requestClose

Asks the host to dismiss the current view. The promise resolves once the request is sent, not when the view closes: the host owns the decision and returns no acknowledgement, so the view cannot tell whether it was actually dismissed.

Design for the Host

Where dismissing a view fits in the view lifecycle

useRequestModal

Open the modal view you later close

useDisplayMode

Request a different layout instead of closing