The translation was generated automatically and may contain mistakes
RouteNavigator.hideModal
Hides an open modal window.
Example
TypeScript
import { useRouteNavigator } from '@vkontakte/vk-mini-apps-router';
<ModalRoot
activeModal={activeModal}
onClose={() => routeNavigator.hideModal()}
>
<PersikModal nav='persik_modal'></PersikModal>
<UserModal nav='user_modal'></UserModal>
</ModalRoot>Announcement
TypeScript
hideModal(pushPanel?: boolean, options?: {replace: boolean}): Promise<void>;Parameters
Function parameters
Parameter | Type | Description |
|---|---|---|
pushPanel
optional | boolean | Determines the action when the window is closed.
If the parameter is false , the router takes a step back in the history of transitions.
If the parameter is true , the router takes a step forward, to the panel specified in the modal window route. This functionality works if the modal window was defined route .
Default value: false . |
options | object | The object that describes transition properties . |
Properties of Transition
?4??4??4??1? | Type | Description |
|---|---|---|
replace
optional | boolean | If the parameter is true , the modal window closes without adding an entry to the history . One of the conditions must be met:
• pushPanel = true .
• The recording with the modal window is the first in the history of transitions. For example, if the application was accessed through a direct link.
If the parameter is false , the modal window closes with the addition of an entry in history .
Default value false . |
Result
Object Promise which is allowed if the modal window has been successfully hidden. Works for official purposes. Using this object in your code is usually unnecessary.
Materials on the topic
- •
- •
- •
- •
- •