I don't want to include this property in state or props. Just on this of the component.
This is what I am doing:
class accountTrack<{},{}> {
constructor() {
this.resetConfig();
}
async init(userMoId:string, accountMoId:string, email:string) {
this._id = uniqueId();
this.userMoId = userMoId;
this.accountMoId = accountMoId;
}}
But for some reason, I am getting this kind of errors:
Looking for the way of proper usage
Just declare it the component:
class accountTrack<{},{}> {
declare _id?: string;
declare userMoId?: string;
declare accountMoId?: string;
constructor() {
this.resetConfig();
}
async init(userMoId:string, accountMoId:string, email:string) {
this._id = uniqueId();
this.userMoId = userMoId;
this.accountMoId = accountMoId;
}}