If you have to extend an existing object with additional property, always prefer Vue.set()
over Object.assign()
(or spread operator).
Example below explains implications for different implementations.
import { ReactNode, useRef } from 'react' | |
import { Button, FormControl, FormErrorMessage, FormLabel, Icon, InputGroup } from '@chakra-ui/react' | |
import { useForm, UseFormRegisterReturn } from 'react-hook-form' | |
import { FiFile } from 'react-icons/fi' | |
type FileUploadProps = { | |
register: UseFormRegisterReturn | |
accept?: string | |
multiple?: boolean | |
children?: ReactNode |