by pier25 · 6y ago · 0 comments
Not really. That's the point of making components in React/Vue/Svelte/etc, you can create reusable modular parts.
As an example you say have a DataGridView , a giant component with a lot of features and you need to modify something, can you do it in React using inheritance like functionality and not risking breaking anything where the component is already used ?
Just right now I'm building a component that abstracts filtering and sorting for lists of items in Svelte.
By extending a RadioButton and overriding the paint method I can do it in 1 minute. The component would still be a radiobutton, same interface, same events,same keyboard shortcuts, same accessibility, focus/tab-order behaviour.
In React you would start with a div, put 2 img inside it and implement the toggle logic, After that you need to add the events, the keyboard shortcuts, the tab ordering, focusing, accessibility.
If you had a library of React components, and it had a BaseRadioButton, if properly designed you could use it to compose other components (radio buttons, forms, etc).
Apart from the fact though that your understanding of a toggle on the web is switching visibility on images instead of building the button how the design wants it and not unnecessarily load images shows that you not only sound quite like an ass but are also so stuck up that you think your understanding is good enough to compare your experiences.
Hint: It's not. Get over yourself and maybe put on a gentle tone next time you're trying to make a bad argument.
This is also pure gold that I can't believe you actually would do
> start with a div