tachybase_todo/docs/en-US/development/client/ui-schema-designer/x-initializer.md
chenos b8d0ad8fbc
feat: update docs (#996)
* feat: update docs

* feat: update docs

* fix: update docs

* Add files via upload

* Add files via upload

* Update the-first-app.md

* Update the-first-app.md

* Update v08-changelog.md

* feat: update docs

Co-authored-by: Zhou <zhou.working@gmail.com>
2022-10-31 22:41:24 +08:00

977 B

x-initializer 组件

内置 x-initializer 组件

  • BlockInitializers
  • CalendarActionInitializers
  • CreateFormBlockInitializers
  • CustomFormItemInitializers
  • DetailsActionInitializers
  • FormActionInitializers
  • FormItemInitializers
  • KanbanActionInitializers
  • ReadPrettyFormActionInitializers
  • ReadPrettyFormItemInitializers
  • RecordBlockInitializers
  • RecordFormBlockInitializers
  • SubTableActionInitializers
  • TableActionColumnInitializers
  • TableActionInitializers
  • TableColumnInitializers
  • TableSelectorInitializers
  • TabPaneInitializers

替换

import React, { useContext } from 'react';
import { SchemaInitializerContext } from '@nocobase/client';

export default React.memo((props) => {
  const items = useContext(SchemaInitializerContext);
  const BlockInitializers = {};
  return (
    <SchemaInitializerContext.Provider value={{ ...items, BlockInitializers }}>
      {props.children}
    </SchemaInitializerContext.Provider>
  );
});