Skip to main content

useResendCode()

function useResendCode(): {
resendCode: () => void
resendCodeNode: undefined | UiNode
}

useResendCode provides a callback to trigger a code resend in the current flow.

You may use this hook to implement a "Resend Code" button in your forms.

If the current flow does not support code resending, resendCodeNode will be undefined and resendCode will be a no-op.

Example:

const { resendCode, resendCodeNode } = useResendCode();

return (
{resendCodeNode && (
<button onClick={resendCode}>Resend Code</button>
)}
)

Returns

{
resendCode: () => void;
resendCodeNode: undefined | UiNode;
}

the callback to trigger a code resend

NameTypeDefault value
resendCode()() => voidhandleResend
resendCodeNodeundefined | UiNode-