Using the same techniques for deciding if you should create a new function or object. One such technique is the single responsibility principle,
single responsibility principle is, a component should ideally only do one thing. If it ends up growing, it should be decomposed into smaller subcomponents.
Since you’re often displaying a JSON data model to a user, you’ll find that if your model was built correctly, your UI (and therefore your component structure) will map nicely. That’s because UI and data models tend to adhere to the same information architecture. Separate your UI into components, where each component matches one piece of your data model.
Adding the Inverse Data Flow that allows us to send data between parent and child components as props, or properties. However, components that are cousins or siblings cannot directly communicate with each other.
React is all about one-way data flow down the component hierarchy. It may not be immediately clear which component should own what state. This is often the most challenging part for newcomers to understand, so follow these steps to figure it out: