DEV Community

Discussion on: Organize React Components Better with Barrel Exports

Collapse
alaindet profile image
Alain D'Ettorre

Finally, someone talking about our Lord and Savior the barrel file

Collapse
justmyrealname profile image
Joe Ziemba Author

Amen 🙏 Such an underrated pattern!

Collapse
alaindet profile image
Alain D'Ettorre

I literally use it everywhere, in any language (including SCSS!) and I'm starting to get grumpy about languages not having it.

Other than imports, the cool thing about it is being able to truly refactor features without breaking anything, since features are often contained in their own directory. Also, it's basically mandatory if you want to build any NPM package.