()
| 3 | |
| 4 | it('should type state.value properly', () => { |
| 5 | function Comp() { |
| 6 | const form = createForm( |
| 7 | () => |
| 8 | ({ |
| 9 | defaultValues: { |
| 10 | firstName: 'test', |
| 11 | age: 84, |
| 12 | }, |
| 13 | }) as const, |
| 14 | ) |
| 15 | |
| 16 | return ( |
| 17 | <> |
| 18 | <form.Field |
| 19 | name="firstName" |
| 20 | children={(field) => { |
| 21 | expectTypeOf(field().state.value).toEqualTypeOf<'test'>() |
| 22 | return null |
| 23 | }} |
| 24 | /> |
| 25 | <form.Field |
| 26 | name="age" |
| 27 | children={(field) => { |
| 28 | expectTypeOf(field().state.value).toEqualTypeOf<84>() |
| 29 | return null |
| 30 | }} |
| 31 | /> |
| 32 | </> |
| 33 | ) |
| 34 | } |
| 35 | }) |
| 36 | |
| 37 | it('should type onChange properly', () => { |
nothing calls this directly
no test coverage detected