Skip to content

Commit

Permalink
feat: get
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyair committed Nov 30, 2023
1 parent 83b574b commit 252fde3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/components/form/form-subscribe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Values = any> = (
changedValues: Record<string, any>,
Expand All @@ -19,7 +19,7 @@ export interface FormSubscribeProps {
export const FormSubscribe: FC<FormSubscribeProps> = 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(
Expand Down

0 comments on commit 252fde3

Please sign in to comment.