Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Components (2018) Build Modular Interfaces with Components Separating Function Components Into Modules

Difference between Module and Component.

Where exactly is the difference between Module and Component? I know there are ES Modules. The folder in the project is named components. It's where modules live in files?!

Routine Poutine
Routine Poutine
26,050 Points

I'm pretty sure modules are pre-written software that are either included in an environment like the browser or Nodejs or something of your own doing. If it needs to be downloaded, its a package. In contrast, components are classes or functions written in React. I'm not sure what makes React a library rather than a module -- size?

1 Answer

Coming back to my own question a a couple of years later ;) I think it is meant like this: We break the App down in logical components or units like Header, Footer etc. and use ES modules (which is a javascript-specific term) to organize them.