arnthor3 / react-bootstrap-toggle

Bootstrap-toggle without the JQuery dependencies
Other
53 stars 17 forks source link

`className` prop being ignored #29

Closed BeigeBadger closed 6 years ago

BeigeBadger commented 6 years ago

In https://github.com/arnthor3/react-bootstrap-toggle/blob/master/src/react-bootstrap-toggle.jsx a className property is defined, and this property is applied to the outermost div inside the render method.

However this property is not initialised inside the defaultProps and does not seem to be applied at all when I use it like so:

import React, { Component, PropTypes } from 'react';
import Toggle from 'react-bootstrap-toggle';

import 'react-bootstrap-toggle/lib/bootstrap2-toggle.css';

class MyComponent extends Component {
    ...
    render() {
        return (
            <Toggle size={`xs`} on={`Yes`} off={`No`} onstyle={`success`} offstyle={`danger`} className={`span3`} />
        );
    }
...

The value that I enter for className appears to be thrown away, I also noticed that it is not mentioned in the readme file as a prop that can be set - is this a mistake or am I using it incorrectly?

BeigeBadger commented 6 years ago

NVM, using an older, locally cached version.