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

159
Views
How to reference Jsx files inside another Jsx file?

I’m currently building a React app. I have defined two files with default functions and I’m calling inside a “home” file. However, I’m having the warning “is defined but never used”. How can I solve that issue?

Below is the code that I’ve used for home.jsx:

import veggie from "../components/veggie";
import popular from "../components/popular";



function home() {
  return (
    <div>
      <veggie />
      <popular />
    </div>
  )
}

export default home;

And for veggie.jsx so far I’ve used this code:


function veggie() {
  return <div>veggie</div>;
  
}

export default veggie;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try capital first letter for the component name in import statements:

import Veggie from "../components/veggie";
import Popular from "../components/popular";

function Home() {
  return (
    <div>
      <Veggie />
      <Popular />
    </div>
  )
}

export default Home;

Source: 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!