Exporting composed components, how does it work?

Often in React, I have seen a lot of lines that export higher order components and look like

export default compose(someComposer)(someComponent);

How does this work? Is it evaluated as soon as the file is read? As soon as it is imported? Once it’s used in a render statement?

A composed is still a component, therefore what’s exported is the component.

React components are functions or classes, although, functions are also classes behind the scenes.

That being said, what’s exported is the reference of the class itself as a react element and it is only when they are present in the rendered tree that they instantiated.

The actual evaluation of the exported component happens once or more after the first time it is set to appear on the dom tree and its reevaluation happens based on its prop changes.