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

164
Views
¿Cómo hacer referencia a archivos Jsx dentro de otro archivo Jsx?

Actualmente estoy construyendo una aplicación React. He definido dos archivos con funciones predeterminadas y estoy llamando dentro de un archivo "inicio". Sin embargo, tengo la advertencia "está definido pero nunca se usa". ¿Cómo puedo solucionar ese problema?

A continuación se muestra el código que he usado para home.jsx:

 import veggie from "../components/veggie"; import popular from "../components/popular"; function home() { return ( <div> <veggie /> <popular /> </div> ) } export default home;

Y para veggie.jsx hasta ahora he usado este código:

 function veggie() { return <div>veggie</div>; } export default veggie;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Pruebe con la primera letra mayúscula para el nombre del componente en declaraciones de importación:

 import Veggie from "../components/veggie"; import Popular from "../components/popular"; function Home() { return ( <div> <Veggie /> <Popular /> </div> ) } export default Home;

Fuente: https://reactjs.org/docs/jsx-in-depth.html#user-defined-components-must-be-capitalized

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!