gambar reaksi-hook-bentuk

const ImageUploader = ({
  errorMessage, name, watch, register, validationRules
}: TProps) => (
  <Container>
    <Col1>
      <Title>Choose logo</Title>
      <input
        type="file"
        accept=".jpg,.jpeg,.png"
        {...register(name, {
          required: true,
          pattern: {
            value: validationRules,
            message: errorMessage
          }
        })}
        name={name}
      />
      <span>{errorMessage}</span>
    </Col1>
    <Image
      alt="default"
      src={
        watch === undefined || watch.length === 0
          ? 'https://upload.wikimedia.org/wikipedia/commons/7/78/Image.jpg'
          : URL.createObjectURL(watch[0])
      }
    />
  </Container>
)
Kichuk Egor