Skip to content

Commit 38e752c

Browse files
committed
update setValue
1 parent 90074f1 commit 38e752c

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

src/content/docs/useform/setvalue.mdx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,6 @@ This function allows you to dynamically set the value of a <strong>registered</s
3535
setValue("array.0.test2", "2")
3636
```
3737

38-
- The method will not create a new field when targeting a non-existing field.
39-
40-
```javascript
41-
const { replace } = useFieldArray({ name: "test" })
42-
43-
// ❌ doesn't create new input
44-
setValue("test.101.data")
45-
46-
// ✅ work on refresh entire field array
47-
replace([{ data: "test" }])
48-
```
49-
50-
- Only the following conditions will trigger a re-render:
51-
- When an error is triggered or corrected by a value update.
52-
- When `setValue` cause state update, such as dirty and touched.
53-
5438
- It's recommended to target the field's name rather than make the second argument a nested object.
5539

5640
```javascript

0 commit comments

Comments
 (0)