MCPcopy Index your code
hub / github.com/TanStack/form / Comp

Function Comp

packages/solid-form/tests/createField.test-d.tsx:5–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3
4it('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
37it('should type onChange properly', () => {

Callers

nothing calls this directly

Calls 1

createFormFunction · 0.90

Tested by

no test coverage detected