【发布时间】:2023-01-01 02:45:18
【问题描述】:
“反应下降区”:“^ 14.2.2”
const { getRootProps, getInputProps, isDragActive } = useDropzone({
accept: {
"image/*": [".jpeg", ".png", ".jpg"],
},
错误:
MediaField.tsx:266:5 - error TS2322: Type 'string | { "image/*": string[]; }' is not assignable to type 'Accept'.
Type 'string' is not assignable to type 'Accept'.
266 accept: {
~~~~~~
node_modules/react-dropzone/typings/react-dropzone.d.ts:31:3
31 accept?: Accept;
~~~~~~
The expected type comes from property 'accept' which is declared here on type 'DropzoneOptions'
我想念什么?
【问题讨论】:
标签: typescript image react-dropzone http-accept-header