Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

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

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

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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;
  }}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda