Is it necessary to create a ui component(s) for a single call in one page?

35 Views Asked by At

I am about to create a Vue.js project and i use the smart/dumb pattern for my ui components. In my dumb components I have already the input, buttons and etc..., but in my smart components I am curios if it is really necessary to create a component if i will use that only in one page. For example. login-form component, then i will use that only in login page. So, ⤵️

My first question, is it really necessary to create a component for that ?

Second question, and when will i gonna create a smart components?

1

There are 1 best solutions below

0
Eduardo On BEST ANSWER
  1. Moving code to another components makes code of initial component more readable. Even if you are going to use that new components only once.

  2. Usually smart components - are pages that fetch or simply share some data to its children.