我导入的组件如下:
import { Form } from 'react-bootstrap'
<Form.File
id='image-file'
label='Choose File'
custom
onChange={uploadFileHandler}
></Form.File>
我得到以下错误:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
没有这样的组件称为Form.File。您必须使用type="的Form.Control;文件":
https://react-bootstrap.github.io/forms/form-control/#file-输入