I am trying to use react hook form for user input to upload file
import "./styles.css";
import { useForm, Controller } from "react-hook-form";
import {
  Col,
  Row,
  Form,
  FormGroup,
  InputGroup,
  Input,
  Container,
  Button
} from "reactstrap";
export default function App() {
  const onSubmit = (data) => {
    console.log(data);
  };
  const { control, handleSubmit } = useForm();
  return (
    <Container>
      <Form onSubmit={handleSubmit(onSubmit)}>
        <Row className="m-3">
          <Col>
            <FormGroup row className="mr-md-1">
              <InputGroup className="mb-3">
                <Controller
                  name="itemlist2"
                  control={control}
                  render={({ field: { ref, ...field } }) => (
                    <Input
                      {...field}
                      type="file"
                      required
                      innerRef={ref}
                      onChange={(e) => {
                        field.onChange(e.target.files);
                      }}
                    />
                  )}
                />
              </InputGroup>
            </FormGroup>
          </Col>
        </Row>
        <Button color="primary" className="mr-1">
          {"Save Changes"}
        </Button>
      </Form>
    </Container>
  );
}
Check on https://codesandbox.io/s/affectionate-moon-dmn8q
I get

 
    
 
    