Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

TypeScript error when property is set on `this` of the Component : Property 'X' does not exist on type Classname

$
0
0

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:

enter image description here

Looking for the way of proper usage


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>