> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# Function: useSetDefaultValue()

> **useSetDefaultValue**(`shouldTriggerSaveCallback`: `object`): `void`

Persists a component's default/initial value into form state once streaming
finishes — but only if the user hasn't already set a value.

Call this inside any form component that has a `defaultValue` or
`defaultChecked` prop. It is a no-op during streaming so that LLM
prop changes don't fight with partial state.

## Parameters

| Parameter                                              | Type                                                                                                                                                                      | Description                                                     |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| `shouldTriggerSaveCallback`                            | \{ `componentType?`: `string`; `defaultValue`: `unknown`; `existingValue`: `unknown`; `formName?`: `string`; `name`: `string`; `shouldTriggerSaveCallback?`: `boolean`; } | Defaults to `false` (only local state, no message persistence). |
| `shouldTriggerSaveCallback.componentType?`             | `string`                                                                                                                                                                  | -                                                               |
| `shouldTriggerSaveCallback.defaultValue`               | `unknown`                                                                                                                                                                 | -                                                               |
| `shouldTriggerSaveCallback.existingValue`              | `unknown`                                                                                                                                                                 | -                                                               |
| `shouldTriggerSaveCallback.formName?`                  | `string`                                                                                                                                                                  | -                                                               |
| `shouldTriggerSaveCallback.name`                       | `string`                                                                                                                                                                  | -                                                               |
| `shouldTriggerSaveCallback.shouldTriggerSaveCallback?` | `boolean`                                                                                                                                                                 | -                                                               |

## Returns

`void`
