utils.js
const array = [1,2,3,4,5,6,7,8];
export default (props)=>{return <div>{array.map(()=>do something)}</div>}
index.js
import Comp from './utils.js';
I know that when you require a module, it remains in memory cache, so if you call it twice it, the module will not run and give you back the exported functions.
In this case we have a const variable. The exported function has a reference to variable and because the exported function remains in cache that means that the const variable remains also and is not GB. Is this right? If not what does actually happen?