REACT help with Component Setup

Hello ! So I have a React question and am trying to figure out the concept of components.

I am working on a project right now. My goal is to have a user enter data on the left side and have it display as a graph on the right side. Right now the entry form is in a div on the left side and the graph display is in a div on the right side. They are both wrapped in a MainContainer component.

My question is this: Should I have each div in a separate component WITHIN the MainContainer component? Iā€™m trying to think ahead about state and props and passing data. Any help would be greatly appreciated because this is my first true solo React project!

A component is you just making a reusable template of code so you can use it multiple times all over your app, so if you plan on using these inputs or charts more than once i would put them into components, but if your only using them this once you can probably leave them as they are.

1 Like

I would create a component for the form then another component for the Data Display so your code stays clean!

1 Like

Thanks for the help!

Thanks for the helpful tips!