News for hackers. Stuff that matters.
Re:Elemental UI for React.js by the_gipsy on Monday August 24, 2015 @09:43AM (#10109607)
You will most likely attach an event listener to the button. You could just use `element.addEventListener`, but that's not consistent if you use React for other form elements.

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.

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.

Re:Elemental UI for React.js by chillacy on Monday August 24, 2015 @06:30PM (#10113274)
> 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.