refactor(form): optimize useDataFormItemProps hook (#5484)
Some checks are pending
Build docker image / build-and-push (push) Waiting to run
Build pro image / build-and-push (push) Waiting to run
Deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase frontEnd test / frontend-test (18) (push) Waiting to run

This commit is contained in:
Sheldon Guo 2024-10-24 09:29:43 +08:00 committed by GitHub
parent 48f1827f94
commit f7a368f802
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,9 +8,10 @@
*/
import { useForm } from '@formily/react';
import { useCollectionRecordData } from '../../../../../data-source/collection-record/CollectionRecordProvider';
import { useSatisfiedActionValues } from '../../../../../schema-settings/LinkageRules/useActionValues';
export function useDataFormItemProps() {
const form = useForm();
const { valueMap: style } = useSatisfiedActionValues({ category: 'style', formValues: form?.values });
const data = useCollectionRecordData();
const { valueMap: style } = useSatisfiedActionValues({ category: 'style', formValues: data });
return { wrapperStyle: style };
}