Prevents accidental navigation away from the current page while active is true.
active
popstate
dialogOpen
When the user confirms via confirm(), onConfirmLeave is called if provided, otherwise history.back() fires to complete the original navigation.
confirm()
onConfirmLeave
history.back()
Prevents accidental navigation away from the current page while
activeis true.popstate, settingdialogOpento true so the consumer can show a confirmation UI.When the user confirms via
confirm(),onConfirmLeaveis called if provided, otherwisehistory.back()fires to complete the original navigation.