When Should You Split Components?
As you work with React and learn more and more about it, and as you dive into more challenging React projects, you will most likely come up with one very common question: When should I split a single React component into multiple separate components?
As mentioned earlier in this chapter, React is all about components, and it is therefore very common to have dozens, hundreds, or even thousands of React components in a single React project.
When it comes to splitting a single React component into multiple smaller components, there is no hard rule you must follow. As mentioned earlier, you could put all your UI code into one single, large component. Alternatively, you could create a separate custom component for every single HTML element and piece of content that you have in your UI. Both approaches are probably not that great. Instead, a good rule of thumb is to create a separate React component for every data entity that can be identified.
...