Structuring our React application
We have already improved some things by using React patterns. You should do some homework and introduce those patterns wherever possible.
When writing applications, one key objective is to keep them modular and readable but also as understandable as possible. It is always hard to tell when splitting code up is useful and when it overcomplicates things. This is something that you will learn more and more about by writing as many applications and as much code as possible.
Let's begin to structure our application further.
The React file structure
We have already saved our Loading
and Error
components in the components
folder. Still, there are many parts of our components that we did not save in separate files to improve the readability of this book.
I will explain the most important solution for unreadable React code in one example. You can implement this on your own later for all other parts of our application, as you should not read...