Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

className vs class #346

Closed
cbrake opened this issue Sep 12, 2013 · 2 comments
Closed

className vs class #346

cbrake opened this issue Sep 12, 2013 · 2 comments

Comments

@cbrake
Copy link

cbrake commented Sep 12, 2013

in the jquery-bootstrap example, I see:

// Simple pure-React component so we don't have to remember
// Bootstrap's classes
var BootstrapButton = React.createClass({
  render: function() {
    // transferPropsTo() is smart enough to merge classes provided
    // to this component.
    return this.transferPropsTo(
      <a href="javascript:;" role="button" className="btn">
        {this.props.children}
      </a>
    );
  }
});

Would class="btn" be equivalent to className="btn"? Is one preferred over the other?

@chenglou
Copy link
Contributor

@cbrake the use of class is now deprecated, check #328. There's a discussion on google groups also: https://groups.google.com/forum/#!topic/reactjs/xovHWHGHPCA

@cbrake
Copy link
Author

cbrake commented Sep 13, 2013

@chenglou thanks for the explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants