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?