React export

Hello! This is taken from codecademys intro course to React. In the app.js file, this code example is used:
import React from 'react';

function MyComponent() {
return <h1>Hello, I'm a functional React Component!</h1>;
}

export default MyComponent;
import React from 'react';

function MyComponent() {
return <h1>Hello, I'm a functional React Component!</h1>;
}

export default MyComponent;
Then it says "On the last line of the above code block, MyComponent is exported so it can be used later." So my question is, where is it exported to, before it is imported in an index.js file?
3 Replies
Jochem
Jochem2y ago
it's not, that's just the terminology that's used for a module file making something available when it's imported
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Å Marlon G
Å Marlon GOP2y ago
Very good! And the reason I asked was because I was worried that code was being cached somewhere, and that would affect performance, whatever. Thanx guys! 🙌
Want results from more Discord servers?
Add your server