mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 21:16:15 +00:00
refactor(CollectionField): extract CollectionFieldInternalField component
This commit is contained in:
parent
87f0ac38e4
commit
cec5def70b
@ -13,7 +13,7 @@ import { useDynamicComponentProps } from '../../hoc/withDynamicSchemaProps';
|
|||||||
import { useComponent } from '../../schema-component';
|
import { useComponent } from '../../schema-component';
|
||||||
import { useCollectionField } from './CollectionFieldProvider';
|
import { useCollectionField } from './CollectionFieldProvider';
|
||||||
|
|
||||||
export const CollectionField = connect((props) => {
|
const CollectionFieldInternalField = (props) => {
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const { uiSchema } = useCollectionField();
|
const { uiSchema } = useCollectionField();
|
||||||
const Component = useComponent(
|
const Component = useComponent(
|
||||||
@ -24,6 +24,10 @@ export const CollectionField = connect((props) => {
|
|||||||
if (!uiSchema) return null;
|
if (!uiSchema) return null;
|
||||||
|
|
||||||
return <Component {...props} {...dynamicProps} />;
|
return <Component {...props} {...dynamicProps} />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const CollectionField = connect((props) => {
|
||||||
|
return <CollectionFieldInternalField {...props} />;
|
||||||
});
|
});
|
||||||
|
|
||||||
CollectionField.displayName = 'CollectionField';
|
CollectionField.displayName = 'CollectionField';
|
||||||
|
Loading…
Reference in New Issue
Block a user