File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,10 @@ import type { FieldComponent } from './useField'
18
18
import type { ReactFormExtendedApi } from './useForm'
19
19
import type { AppFieldExtendedReactFieldGroupApi } from './useFieldGroup'
20
20
21
+ // We should never hit the `null` case here
22
+ const fieldContext = createContext < AnyFieldApi > ( null as never )
23
+ const formContext = createContext < AnyFormApi > ( null as never )
24
+
21
25
/**
22
26
* TypeScript inferencing is weird.
23
27
*
@@ -56,9 +60,6 @@ type UnwrapDefaultOrAny<DefaultT, T> = [DefaultT] extends [T]
56
60
: T
57
61
58
62
export function createFormHookContexts ( ) {
59
- // We should never hit the `null` case here
60
- const fieldContext = createContext < AnyFieldApi > ( null as never )
61
-
62
63
function useFieldContext < TData > ( ) {
63
64
const field = useContext ( fieldContext )
64
65
@@ -92,9 +93,6 @@ export function createFormHookContexts() {
92
93
>
93
94
}
94
95
95
- // We should never hit the `null` case here
96
- const formContext = createContext < AnyFormApi > ( null as never )
97
-
98
96
function useFormContext ( ) {
99
97
const form = useContext ( formContext )
100
98
You can’t perform that action at this time.
0 commit comments