4 ms·
Not sure about the perf difference between DOM elements and component elements, but the primary reason would be: let's say later on you decide each <kbd> should
by exogen 10y ago
Not sure about the perf difference between DOM elements and component elements, but the primary reason would be: let's say later on you decide each <kbd> should have a className, or a little tooltip helper, or a title attribute, or some ARIA role or something. Since you can't modify the built-in DOM elements, you'd have to find each instance where you used <kbd> throughout the codebase. If they're wrapped, you can just modify the <Kbd> wrapper in one place and the new output is rendered everywhere.
- thejameskyle 10y agoThis is exactly it. Also if we ever choose to use React Native (cough), it would be good not to have hard coded DOM elements. I haven't tested the performance heavily but I'm not really concerned about it.