diff --git a/package.json b/package.json index a391716..d56c7f2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/jsdir/react-ladda#readme", "dependencies": { - "ladda": "^1.0.0", + "ladda": "^2.0.0", "prop-types": "^15.5.8" }, "devDependencies": { diff --git a/src/LaddaButton.jsx b/src/LaddaButton.jsx index c967da9..f303cbc 100644 --- a/src/LaddaButton.jsx +++ b/src/LaddaButton.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import Ladda from 'ladda' +import { create } from 'ladda' import { SIZES, STYLES } from './constants' @@ -48,7 +48,7 @@ class LaddaButton extends Component { }; componentDidMount() { - this.laddaInstance = Ladda.create(this.node) + this.laddaInstance = create(this.node) if (this.props.loading) { this.laddaInstance.start() @@ -75,11 +75,6 @@ class LaddaButton extends Component { if (props.loading !== this.props.loading) { if (props.loading) { this.laddaInstance.start() - } else if (props.disabled) { - // .stop removes the attribute "disabled" - // .disable calls .stop then adds the attribute "disabled" - // see https://github.com/hakimel/Ladda/blob/master/js/ladda.js - this.laddaInstance.disable() } else { this.laddaInstance.stop() }