4 ms·
> Drop one html tag like <div class="main"> in react and it breaks. Can you explain? That is entirely valid JSX and you should be able to drop it in any React
by ng12 7y ago
> Drop one html tag like <div class="main"> in react and it breaks.
Can you explain? That is entirely valid JSX and you should be able to drop it in any React component.
- wolco 7y agoI didn't know class was valid in jdx previously this had to be changed to className
- ovyerus 7y agoclass is a perfectly valid property in jsx, as it just gets mapped to `{"class": ...}`, however react adopts to use className instead because of the dom api `el.className = ...`, but also some stuff like older versions of IE. most other jsx-based things like hyperapp accept `class` just fine from what i know