diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac7848f4ed..d86d44f204 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,8 +40,8 @@ dependencies: specifier: ^4.17.21 version: 4.17.21 rc-field-form: - specifier: ~1.27.4 - version: 1.27.4(react-dom@18.2.0)(react@18.2.0) + specifier: ~1.41.0 + version: 1.41.0(react-dom@18.2.0)(react@18.2.0) rc-util: specifier: ^5.30.0 version: 5.37.0(react-dom@18.2.0)(react@18.2.0) @@ -14536,8 +14536,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /rc-field-form@1.27.4(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-PQColQnZimGKArnOh8V2907+VzDCXcqtFvHgevDLtqWc/P7YASb/FqntSmdS8q3VND5SHX3Y1vgMIzY22/f/0Q==} + /rc-field-form@1.34.2(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-BdciU5C7dBO51/9ZKcMvK2f8zaaO12Lt1eBhlAo8nNv+6htlNcgY9DAkUlZ7gfyWjnCc1Oo4hHIXau1m6tLw1A==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -14548,10 +14548,10 @@ packages: rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - dev: false + dev: true - /rc-field-form@1.34.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-BdciU5C7dBO51/9ZKcMvK2f8zaaO12Lt1eBhlAo8nNv+6htlNcgY9DAkUlZ7gfyWjnCc1Oo4hHIXau1m6tLw1A==} + /rc-field-form@1.41.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-k9AS0wmxfJfusWDP/YXWTpteDNaQ4isJx9UKxx4/e8Dub4spFeZ54/EuN2sYrMRID/+hUznPgVZeg+Gf7XSYCw==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -14562,7 +14562,7 @@ packages: rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - dev: true + dev: false /rc-image@5.13.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-iZTOmw5eWo2+gcrJMMcnd7SsxVHl3w5xlyCgsULUdJhJbnuI8i/AL0tVOsE7aLn9VfOh1qgDT3mC2G75/c7mqg==} diff --git a/src/components/form/form-subscribe.tsx b/src/components/form/form-subscribe.tsx index 4198378df4..afa722ac2d 100644 --- a/src/components/form/form-subscribe.tsx +++ b/src/components/form/form-subscribe.tsx @@ -3,7 +3,7 @@ import type { FC, ReactNode } from 'react' import { FieldContext, useWatch } from 'rc-field-form' import type { FormInstance } from 'rc-field-form' import type { NamePath } from 'rc-field-form/es/interface' -import pick from 'lodash/pick' +import getValue from 'rc-util/lib/utils/get' type RenderChildren = ( changedValues: Record, @@ -19,7 +19,7 @@ export interface FormSubscribeProps { export const FormSubscribe: FC = props => { const form = useContext(FieldContext) - const value = useWatch(values => pick(values, props.to), form) + const value = useWatch(values => getValue(values, props.to), form) // Memo to avoid useless render const childNode = React.useMemo(