I have the following types defined and I am trying to use with ref and don't want to define all the props default value initially, but I am TS error: No Overload Matches this call
interface EmailReminder {
bcc_emails: string[] | null;
cc_emails: string[];
from_email: string;
message: string;
offset_days: number;
subject: string;
to_emails: string[];
sent_at: string | Date;
uuid: string;
}
And when I am trying to create a reactive variable with Vue 3 ref, by passing my type in place of generic, the typescript gets angry and throws the following error.
const reminder = ref<EmailReminder>({
to_emails: [],
cc_emails: [],
message: '',
subject: '',
});
Could someone please tell me what I am doing wrong here, I don't want to make some properties optional and event don't want to use as to remove them.
