4 ms·
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'
by everdimension 11y ago
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.
- chillacy 11y ago> 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.