我像这样导入组件:
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.
1条答案
按热度按时间oxiaedzo1#
没有名为Form.File的组件。您必须使用Type=“file”的Form.Control:
https://react-bootstrap.github.io/forms/form-control/#file-input