Download react-hook-form/src/logic/getFocusFieldName.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 412 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/getFocusFieldName.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/logic/getFocusFieldName.ts
-
curl -L -o getFocusFieldName.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/logic/getFocusFieldName.ts
412 Bytes
| import type { FieldArrayMethodProps, InternalFieldName } from '../types'; | |
| import isUndefined from '../utils/isUndefined'; | |
| export default ( | |
| name: InternalFieldName, | |
| index: number, | |
| options: FieldArrayMethodProps = {}, | |
| ): string => | |
| options.shouldFocus || isUndefined(options.shouldFocus) | |
| ? options.focusName || | |
| `${name}.${isUndefined(options.focusIndex) ? index : options.focusIndex}.` | |
| : ''; | |