arnthor3 / react-bootstrap-toggle

Bootstrap-toggle without the JQuery dependencies
Other
54 stars 16 forks source link

There's no Toggle component #11

Closed 0181532686cf4a31163be0bf3e6bb6732bf closed 7 years ago

0181532686cf4a31163be0bf3e6bb6732bf commented 7 years ago

Only Bootstrap2Toggle:

$ node
> var t = require('react-bootstrap-toggle')
Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
undefined
> t.
t.__defineGetter__      t.__defineSetter__      t.__lookupGetter__      t.__lookupSetter__      t.__proto__
t.constructor           t.hasOwnProperty        t.isPrototypeOf         t.propertyIsEnumerable  t.toLocaleString
t.toString              t.valueOf               

t.Bootstrap2Toggle      t.__esModule            t.default               

> t.Bootstrap2Toggle
[Function: ReactBootstrap2Toggle]
arnthor3 commented 7 years ago

If you take a look at the src/index.jsx you will see that the default export - the t in your case - is bootstrap toggle.

import BootstrapToggle from './react-bootstrap-toggle';
import Bootstrap2Toggle from './react-bootstrap2-toggle';

export default BootstrapToggle;
export { Bootstrap2Toggle };

So this is expected.

0181532686cf4a31163be0bf3e6bb6732bf commented 7 years ago

I'm using require in my code so I had to do this:

var Toggle = require('react-bootstrap-toggle').default;

Thank you!