DEV Community

Discussion on: 5 Essential Practices for Front-End Developers (React Edition)

Collapse
 
hyungjunk profile image
hyungjunk • Edited

Does everybody prefer barrel? In my case, sometimes barrel makes me confused where the component is being imported. And I ended up importing the whole other components when I needed only one component. This slows down the test.

Collapse
 
sufian profile image
Sufian mustafa

I totally get your point, and you're not alone in feeling that way about "export barrel" techniques. It's true that personal preferences and project requirements can play a significant role in choosing the right approach.

The potential confusion you mentioned about where a component is being imported is a valid concern. It's crucial to strike a balance between the convenience of streamlined imports and the potential downsides, like accidentally importing more than needed and impacting test performance.