Skip to content

Commit

Permalink
refactor: replace lodash/merge with deepmerge (#6542)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyunhe authored Feb 6, 2024
1 parent ca09a21 commit 76e3583
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"antd-mobile-v5-count": "^1.0.1",
"classnames": "^2.3.2",
"dayjs": "^1.11.7",
"deepmerge": "^4.3.1",
"lodash": "^4.17.21",
"nano-memoize": "^3.0.16",
"rc-field-form": "~1.27.4",
Expand Down
4 changes: 3 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/components/form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { defaultFormContext, FormContext, FormContextType } from './context'
import { mergeProps } from '../../utils/with-default-props'
import { Header } from './header'
import { useConfig } from '../config-provider'
import merge from 'lodash/merge'
import merge from 'deepmerge'
import { FormArray } from './form-array'
import { traverseReactNode } from '../../utils/traverse-react-node'

Expand Down Expand Up @@ -78,9 +78,8 @@ export const Form = forwardRef<FormInstance, FormProps>((p, ref) => {
const validateMessages = useMemo(
() =>
merge(
{},
locale.Form.defaultValidateMessages,
formProps.validateMessages
formProps.validateMessages || {}
),
[locale.Form.defaultValidateMessages, formProps.validateMessages]
)
Expand Down

0 comments on commit 76e3583

Please sign in to comment.