Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
La propiedad '' no existe en el tipo '', a pesar de tener una interfaz

Estoy tratando de crear un componente de clase. Hice una interfaz para la clase, pero recibo el error Property '' does not exist on type '' en mi propiedad scrollDiv . ¿Qué se perdió en la composición de esta clase?

 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(); } ... }

captura de pantalla del código

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

this.scrollDiv Está accediendo a la propiedad de la clase con esta línea.

Así que tendrías que hacer algo como esto.

 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!