Reputation: 33
I get all the concept of components but one thing I am stuck at is - when to create a component? In other words, what part of the page should be a component?
Taking above image as example, what I think is progress bar can be one component and form, quotes list, blue alert can be second component.
Please advise as necessary.
Upvotes: 3
Views: 1014
Reputation: 7324
There can be many reasons for creating components, such as when you need to create a reusable element, splitting the code to make it easier to understand and reduce code complexity.
In your case 1. you can put both of the sections into a single component or you can put them into separate components if you want to reuse them somewhere. 2. if your code is too much and you want to make it simpler to understand in that case you can also create separate components.
Upvotes: 5