Two-step "arm to confirm" guard for irreversible actions. The first call to
arm() flips confirm true for timeoutMs; acting again while confirm is
true is the real confirmation. It auto-disarms after the timeout (and on
unmount) so a button left armed can never fire a destructive action later.
Pair with onBlur={disarm} so navigating away cancels the armed state.
Two-step "arm to confirm" guard for irreversible actions. The first call to
arm()flipsconfirmtrue fortimeoutMs; acting again whileconfirmis true is the real confirmation. It auto-disarms after the timeout (and on unmount) so a button left armed can never fire a destructive action later. Pair withonBlur={disarm}so navigating away cancels the armed state.