2 ms·
They're definitely more than simple functions if you look at it from the the entire application point-of-view. With components you have access to context and li
by eliseumds 5y ago
They're definitely more than simple functions if you look at it from the the entire application point-of-view. With components you have access to context and lifecycle. Doing:
import someFunc from 'someFunc';
// ...
return someFunc();
is not the same as:
import SomeComponent from 'SomeComponent';
// ...
return <SomeComponent />
- karottenreibe 5y agoIt all depends on how the component is written. And the function. The function could access global variables for example. The component could be pure and not use context. Neither of which you can tell just by looking at the import statement.