2022-12-21 02:01:04 +00:00
|
|
|
# x-initializer
|
2022-10-31 03:52:17 +00:00
|
|
|
|
2022-12-21 02:01:04 +00:00
|
|
|
## Built-in x-initializer component
|
2022-10-31 03:52:17 +00:00
|
|
|
|
|
|
|
- BlockInitializers
|
|
|
|
- CalendarActionInitializers
|
|
|
|
- CreateFormBlockInitializers
|
|
|
|
- CustomFormItemInitializers
|
|
|
|
- DetailsActionInitializers
|
|
|
|
- FormActionInitializers
|
|
|
|
- FormItemInitializers
|
|
|
|
- KanbanActionInitializers
|
|
|
|
- ReadPrettyFormActionInitializers
|
|
|
|
- ReadPrettyFormItemInitializers
|
|
|
|
- RecordBlockInitializers
|
|
|
|
- RecordFormBlockInitializers
|
|
|
|
- SubTableActionInitializers
|
|
|
|
- TableActionColumnInitializers
|
|
|
|
- TableActionInitializers
|
|
|
|
- TableColumnInitializers
|
|
|
|
- TableSelectorInitializers
|
|
|
|
- TabPaneInitializers
|
|
|
|
|
2022-12-21 02:01:04 +00:00
|
|
|
## Replacement
|
2022-10-31 03:52:17 +00:00
|
|
|
|
|
|
|
```tsx |pure
|
|
|
|
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>
|
|
|
|
);
|
|
|
|
});
|
|
|
|
```
|