refactor: code improve

This commit is contained in:
katherinehhh 2023-05-11 17:13:24 +08:00
parent 43f25b44b1
commit c0f0a66ae7

View File

@ -3,16 +3,15 @@ import { RecursionField, useField, useFieldSchema } from '@formily/react';
import React, { useEffect } from 'react';
import { CollectionProvider } from '../../../collection-manager';
import { useInsertSchema } from './hooks';
import { useCollection, useCollectionManager } from '../../../';
import { useCollectionManager } from '../../../';
import schema from './schema';
export const InternalNester = () => {
const field = useField();
const fieldSchema = useFieldSchema();
const insertNester = useInsertSchema('Nester');
const { getField } = useCollection();
const { getCollectionJoinField } = useCollectionManager();
const collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
const collectionField = getCollectionJoinField(fieldSchema['x-collection-field']);
useEffect(() => {
insertNester(schema.Nester);
}, []);