|
|
@@ -1,8 +1,9 @@
|
|
|
+import { FormState } from '@douyinfe/semi-foundation/form/interface';
|
|
|
import React, { useContext } from 'react';
|
|
|
import { FormStateContext } from '../context';
|
|
|
|
|
|
-function useFormState() {
|
|
|
- const formState = useContext(FormStateContext);
|
|
|
+function useFormState<T extends Record<string, any> = any>() {
|
|
|
+ const formState = useContext<FormState<T>>(FormStateContext);
|
|
|
return formState;
|
|
|
}
|
|
|
|