> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# useResend

**useResend(options?)** `[UseResendReturn](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UseResendReturn)`

ACUL 画面での再送操作 (確認コードの再送など) を管理します。

このフックは次の処理を行います:

* クールダウンの残り時間を追跡します。
* 再送ボタンを無効にすべきかどうかを返します。
* 再送を実行してクールダウンを開始する `startResend()` 関数を提供します。
* カウントダウンを `localStorage` に保存するため、再送に伴うページの再読み込み後もカウントダウンが維持されます。

## パラメータ

**options** `[UseResendOptions](/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UseResendOptions)`

`timeoutSeconds` や `onTimeout` などの任意の設定です。

## 戻り値

[`UseResendReturn`](/docs/docs/ja-jp/libraries/acul/react-sdk/API-Reference/Types/interfaces/UseResendReturn)

次を含むオブジェクトです:

* `remaining` — 次に再送できるようになるまでの残り秒数。
* `disabled` — 現在再送できない場合は `true`。
* `startResend` — 再送が許可されている場合、すぐに再送を実行します。

## サポート対象の画面

* `email-identifier-challenge`
* `email-otp-challenge`
* `login-email-verification`
* `login-passwordless-email-code`
* `login-passwordless-sms-otp`
* `mfa-email-challenge`
* `mfa-sms-challenge`
* `mfa-voice-challenge`
* `phone-identifier-challenge`
* `reset-password-mfa-email-challenge`
* `reset-password-mfa-sms-challenge`
* `reset-password-mfa-voice-challenge`

```tsx Example theme={null}
import { useResend } from '@auth0/auth0-acul-react/mfa-sms-challenge';

export function ResendButton() {
  const { remaining, disabled, startResend } = useResend({
    timeoutSeconds: 30,
    onTimeout: () => console.log('You can resend again'),
  });

  return (
    <button onClick={startResend} disabled={disabled}>
      {disabled ? `Resend in ${remaining}s` : 'Resend Code'}
    </button>
  );
}
```

## 備考

* 基盤となる `ResendControl` には明示的な teardown メソッドがないため、このフックで手動クリーンアップを行う必要はありません。
* `timeoutSeconds` または `onTimeout` が変更されると、このフックは再送マネージャーを再初期化します。
