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

155
Views
Reaccionar y mecanografiar, obteniendo el error "Tipo esperado"

Estoy convirtiendo un componente React en Typescript (*.ts) de JS. Está dando el error debajo de "Tipo esperado". ¿Cómo arreglaría esto?

 const SisenseDashboard = () => { const sisenseRef = React.useRef(null); return ( <> <Box display="flex" flexDirection="column" alignItems="center" marginBottom={2} > <h2>In-App Reporting</h2> </Box> <Box ref={sisenseRef} id="sisense-container" className="sisense-demo" ></Box> </> ); };

ingrese la descripción de la imagen aquí

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

0

Primero asegúrese de que la extensión del archivo de su componente sea .tsx . Entonces le gustaría decirle a TypeScript que su función es un componente funcional de React, con la ayuda del tipo FC de React:

 import {FC} from "react"; const SisenseDashboard : FC = () => { const sisenseRef = React.useRef(null); return ( <> <Box display="flex" flexDirection="column" alignItems="center" marginBottom={2} > <h2>In-App Reporting</h2> </Box> <Box ref={sisenseRef} id="sisense-container" className="sisense-demo" ></Box> </> ); };
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!