class → className
niclashoyer opened this issue · 1 comments
niclashoyer commented
I tried to use grunt-react with the 0.5.1 build of react.js. The react team decided that the property className
should be used to add the class
attribute to elements (instead of just class
). Unfortunately grunt-react compiles to class
, e.g.
<div class="test"></div>
compiles to
React.DOM.div( {class:"test"});
but it should be
React.DOM.div( {className:"test"});
That might not be a problem in grunt-react but in react-tools. I just wanted to open this issue, in case someone has the same problems while using grunt-react.
niclashoyer commented
As I thought a bit about it, I think that the change from class
to className
is also required in JSX, so that I think I just got the React documentation wrong, so any JSX like
<div class="test"></div>
should be changed to
<div className="test"></div>
I think that fixes the issue, closing 😄