4 ms·
Oddly enough, I think semantic HTML might be more important for React developers than anyone else. React developers are very vulnerable to creating copious amou
by runawaybottle 5y ago
Oddly enough, I think semantic HTML might be more important for React developers than anyone else. React developers are very vulnerable to creating copious amount of abstract components due to the freedom composability gives you. Over time, it’s possible different people literally speak different languages (even in the same codebase) because of how they see the structure of tags.
Thinking in Semantic HTML might help normalize the variances.
- jeroenhd 5y agoI've run into some bugs because of composition, something about <a> tags nesting breaking everything, but only in release mode (minified etc.). Not fun to hunt down. I don't remember the details, but I've also seen warnings about other semantic stuff that's enforced (it at least complained about) by the framework. Technically you could make everything a div or a text element, but most frameworks you use come with certain expectations: the closer you are to using semantic tags, the less likely you'll be to violate those external expectations. If you're not using any frameworks, I don't see why you wouldn't use semantic tags by default. Sure, you can override the onclick if an anchor with no href and call preventDefault, but why not just use a button instead?