mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:47:10 +00:00
refactor: code improve
This commit is contained in:
parent
43f25b44b1
commit
c0f0a66ae7
@ -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);
|
||||
}, []);
|
||||
|
Loading…
Reference in New Issue
Block a user