useResend(options?)
This React hook manages “resend” actions (e.g., resending a verification code) on ACUL screens.This hook:
- Tracks the remaining cooldown time.
- Tells you whether the resend button should be disabled.
- Provides a
startResendfunction to trigger a resend immediately.
Parameters
options
Optional configuration such as
timeoutSeconds and onTimeout.Returns
UseResendReturnAn object with:remaining— seconds left until the next resend is permitted.disabled—trueif resending is currently blocked.startResend— call to initiate a resend immediately (if allowed).
Supported Screens
email-identifier-challengeemail-otp-challengelogin-email-verificationlogin-passwordless-email-codelogin-passwordless-sms-otpmfa-email-challengemfa-sms-challengemfa-voice-challengephone-identifier-challengereset-password-mfa-email-challengereset-password-mfa-sms-challengereset-password-mfa-voice-challenge
Example
Remarks
- The underlying
ResendControlhas no explicit teardown method; the hook does not require manual cleanup. - The hook re-initializes the resend manager if
timeoutSecondsoronTimeoutchange.