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

76
Views
import components for the whole project

Is it possible to import a component one time and use it everywhere in react project?

For example I have multiple files:

File1.js:

import {comp} from '../reuse/comp.js'
....

File2.js:

import {comp} from '../reuse/comp.js'
....

File3.js:

import {comp} from '../reuse/comp.js'
....

App:

function App() {
    return <div>
              <File1 />
              <File2 />
              <File3 />
           </div>
}

and this is my structure:

-proj
  |---src
       |--- components
       |      |-- File1.js
       |      |-- File2.js
       |      |-- File3.js
       |-- app.css
       |-- app.js
       |---reuse
       |     |-- comp.js 

How can I import once the comp.js in the app.js and use it everywhere?

about 4 years ago · Juan Pablo Isaza
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!