diff --git a/dist/index.js b/dist/index.js index d4a976c5..fbf5c466 100644 --- a/dist/index.js +++ b/dist/index.js @@ -195,7 +195,7 @@ var Swipeout = (0, _createReactClass2.default)({ } else { this._callOnClose(); } - this.refs.swipeoutContent.measure(function (ox, oy, width, height) { + this.swipeoutContent.measure(function (ox, oy, width, height) { var buttonWidth = _this2.props.buttonWidth || width / 5; _this2.setState({ btnWidth: buttonWidth, @@ -337,7 +337,7 @@ var Swipeout = (0, _createReactClass2.default)({ _openRight: function _openRight() { var _this3 = this; - this.refs.swipeoutContent.measure(function (ox, oy, width, height) { + this.swipeoutContent.measure(function (ox, oy, width, height) { var btnWidth = _this3.props.buttonWidth || width / 5; _this3.setState({ @@ -359,7 +359,7 @@ var Swipeout = (0, _createReactClass2.default)({ _openLeft: function _openLeft() { var _this4 = this; - this.refs.swipeoutContent.measure(function (ox, oy, width, height) { + this.swipeoutContent.measure(function (ox, oy, width, height) { var btnWidth = _this4.props.buttonWidth || width / 5; _this4.setState({ @@ -379,6 +379,8 @@ var Swipeout = (0, _createReactClass2.default)({ }, render: function render() { + var _this5 = this; + var contentWidth = this.state.contentWidth; var posX = this.getTweeningValue('contentPos'); @@ -427,7 +429,9 @@ var Swipeout = (0, _createReactClass2.default)({ _react2.default.createElement( _reactNative.View, _extends({ - ref: 'swipeoutContent', + ref: function ref(node) { + return _this5.swipeoutContent = node; + }, style: styleContent, onLayout: this._onLayout }, this._panResponder.panHandlers), @@ -462,7 +466,7 @@ var Swipeout = (0, _createReactClass2.default)({ }, _renderButton: function _renderButton(btn, i) { - var _this5 = this; + var _this6 = this; return _react2.default.createElement(SwipeoutBtn, { backgroundColor: btn.backgroundColor, @@ -472,7 +476,7 @@ var Swipeout = (0, _createReactClass2.default)({ height: this.state.contentHeight, key: i, onPress: function onPress() { - return _this5._autoClose(btn); + return _this6._autoClose(btn); }, text: btn.text, type: btn.type,