contexts.ts 568 B

12345678910111213141516
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { createContext } from 'react';
  6. import type { FormComponents } from './types';
  7. import type { FormSchemaModel } from './model';
  8. /** Model context for each form item */
  9. export const FieldModelContext = createContext<FormSchemaModel>({} as any);
  10. /** The form's model context */
  11. export const FormModelContext = createContext<FormSchemaModel>({} as any);
  12. /** Context of material component map */
  13. export const ComponentsContext = createContext<FormComponents>({});