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

179
Vistas
Property '' does not exist on type '' - despite having interface

I am trying to create a class component. I made an interface for the class, but am getting the error Property '' does not exist on type '' on my scrollDiv property. What was missed in the composition of this class?

 interface ChatTabI {
  state: any;
  scrollDiv: any;
  history: any;
  user: any;
}
class ChatTab extends React.Component<ChatTabI> {
// @ts-ignore

constructor(props) {
    super(props);

    this.state = {
        text: "",
        messages: [],
        loading: false,
        channel: null,
    };

    this.scrollDiv = React.createRef();

 }
...
}

screenshot of code

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

0

this.scrollDiv You are accessing the class property with this line.

So you would need to do something like this.

 interface ChatTabI {
  state: any;
  scrollDiv: any;
  history: any;
  user: any;
}
class ChatTab extends React.Component<ChatTabI> {

  scrollDiv: any; // or whatever this type would be

  constructor(props) {
    super(props);

    this.state = {
        text: "",
        messages: [],
        loading: false,
        channel: null,
    };

    this.scrollDiv = React.createRef();

 }
...
}
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