In this video I will show you how to split components into separate files and then combine them.
Why we need to do that? Because it is a good practice - to store one component in one file. The exception could be some really small components, made with one or two tags.
--------------------------------
Hello, my name is Konstantyn, I'm a Frontend Engineer working in a lovely city of Warsaw. My main technology stack is React. Please ask me questions in comments and subscribe for more tutorials like this!
✅ Follow Me:
LinkedIn: / kostiantyn-burlai
Github: https://github.com/burlai
☕ Buy Me A Coffee: https://www.buymeacoffee.com/konstantyn
--------------------------------
When we are splitting components into separate files, we are using export and import technique to combine them. **It is not a part of react, it is technology of JS modules**.
We can use two types of export named and default. We should use default one, when there is only one component in the file. And named if we want to export several components from one file.
#react #reactjs #reactjstutorial