3 ms·
You can 100% do this, invent your own tags, no need for React to have custom component names. And it works for styling with CSS, just use your custom tag as sel
by dsego 3y ago
You can 100% do this, invent your own tags, no need for React to have custom component names. And it works for styling with CSS, just use your custom tag as selector instead of css class. And then the classes can be used for shared styles.
- 1f60c 3y agoWhen I was 12, I invented my own tag called <t> (I wanted something with no default styling but I didn't know how to do it).
- blowski 3y agoWhat year was that? The custom tags thing used to have a lot more problems than it does now.
- troupo 3y agoBrowsers have always been lenient towards errors in markup. Unknown elements would just be rendered as <p> or <span> (can't remember which). Much later this was codified in HTML 5: if a browser doesn't know an element, it will render it as basically a span (that is, inline element with default styling IIRC).