Hi! Is just an abstraction so you can have separate behaviors/styles in those components down the line. Let's say for example that you want to add that 👁️ button some password fields have to show the password. If you had that directly in the Input then you need to add a ternary or if to show it only when type is "password", but with this approach you can have that button and all its styles encapsulated in the FormPasswordInput component.
Is funny how HTML has input with type to show all kinds of different elements, but for Headings they have h1, h2, h3, and so on.
Thanks a lot for taking the time to read and comment, Yuriy!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.