main
| 1 | import { useWatch } from "react-hook-form" |
| 2 | import { useDataGridContext } from "../context" |
| 3 | |
| 4 | interface UseDataGridDuplicateCellOptions { |
| 5 | duplicateOf: string |
| 6 | } |
| 7 | |
| 8 | export const useDataGridDuplicateCell = ({ |
| 9 | duplicateOf, |
| 10 | }: UseDataGridDuplicateCellOptions) => { |
| 11 | const { control } = useDataGridContext() |
| 12 | |
| 13 | const watchedValue = useWatch({ control, name: duplicateOf }) |
| 14 | |
| 15 | return { |
| 16 | watchedValue, |
| 17 | } |
| 18 | } |