Skip to content

Latest commit

 

History

History
36 lines (31 loc) · 856 Bytes

load_components_as_needed.md

File metadata and controls

36 lines (31 loc) · 856 Bytes

Load components as needed

If you don't want to load all the components, you can do this:

import React from 'react';
import { render } from 'react-dom';
import SchemaForm from 'antd-schema-form/es/SchemaForm';

// Load only the components you need.
import {
  defaultString,
  defaultNumber,
  defaultBoolean,
  defaultArray,
  defaultObject,
  defaultOneOf
} from 'antd-schema-form/es/components/custom/custom';

render(
  <SchemaForm
    customComponent={{
      // You can also customize the default components.
      defaultString,
      defaultNumber,
      defaultBoolean,
      defaultArray,
      defaultObject,
      defaultOneOf
      // ...Other custom components.
    }}
  />
);

The default components are available for viewing here.