chore: show fallback change warning

This commit is contained in:
jialin
2026-02-09 13:26:44 +08:00
parent 83086c46e6
commit e7890dda3d
10 changed files with 113 additions and 33 deletions
@@ -0,0 +1,20 @@
import { PageActionType } from '@/config/types';
import { createContext, useContext } from 'react';
interface FormContextProps {
onFallbackChange?: (changed: boolean) => void;
action?: PageActionType;
currentData?: any;
}
const FormContext = createContext<FormContextProps>({});
export const useFormContext = () => {
const context = useContext(FormContext);
if (!context) {
throw new Error('useFormContext must be used within a FormProvider');
}
return context;
};
export default FormContext;