Re:Elemental UI for React.js
by everdimension on Monday August 24, 2015 @01:17PM
(#10111414)
I'm not sure I understand your answer. The event listener is added via react's 'onClick' attribute which is consistent across all elements.
Things like button's text, color, visibility is nicely controlled via adding/removing classes. And this <Button /> element can create enough spaghetti of its own, too, with attributes like "size", "type", etc, if overused. And with some attributes it can be hard to distinguish native html attributes from component-specific attributes.
> Things like button's text, color, visibility is nicely controlled via adding/removing classes
Isn't the whole point of using React that I don't have to manually manage state like this? When text, color, visibility are all changed independently in different places for more than a handful of states, suddenly it isn't so nicely controlled.
Next, you might want to dynamically change the button's text, color, visibility etc. At that point, if you are using pure DOM API, the code will start to look like spaghetti, unless what you're doing is a really simple one-off form page.