我在Android应用程序中使用AmazonS3Client,使用getObject请求从我的Amazon S3存储桶下载图像.
目前,我得到了这个例外:
com.amazonaws.services.s3.model.AmazonS3Exception:
The specified key does not exist.
(Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey;
Run Code Online (Sandbox Code Playgroud)
即使我能够在S3存储桶中看到具有指定键的对象.
我正在尝试创建一个自定义“输入”组件并扩展默认的 html 输入属性(props)。
然而,我还尝试在我自己的接口定义中使用 Typescript 的 Omit 覆盖默认的“size”属性,但似乎无法让它工作。
(我也尝试过 Typescript 的选择/排除和自定义覆盖类型,但得到相同的错误......)
我已经尝试过类似的线程:
import React from 'react';
type A = React.HTMLAttributes<HTMLInputElement>;
interface InputProps extends Omit<A, 'size'> {
size?: 'sm' | 'md' | 'lg';
}
const Input = (props: InputProps) => {
return <input {...props} />;
};
Run Code Online (Sandbox Code Playgroud)
传输错误
(property) JSX.IntrinsicElements.input: React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>
Type '{ size?: "sm" | "md" | "lg"; defaultChecked?: boolean; defaultValue?: string | number | readonly string[]; suppressContentEditableWarning?: boolean; ... 250 …Run Code Online (Sandbox Code Playgroud)