From 5289083ffd3f6196c2c89fc13d56e2938e0a7789 Mon Sep 17 00:00:00 2001 From: Julien Usson Date: Tue, 31 Mar 2020 15:38:04 +0200 Subject: [PATCH 1/2] :bug: TypeError: Cannot read property 'options' of undefined --- packages/react-nipple/lib/ReactNipple.js | 10 +++++----- packages/react-nipple/src/ReactNipple.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/react-nipple/lib/ReactNipple.js b/packages/react-nipple/lib/ReactNipple.js index 41262e2..74a32e4 100644 --- a/packages/react-nipple/lib/ReactNipple.js +++ b/packages/react-nipple/lib/ReactNipple.js @@ -113,17 +113,17 @@ var ReactNipple = (_class = function (_Component) { value: function handleElement(ref) { this._element = ref; if (ref) { - this.createJoystick(this.props); + this.createJoystick(); } else if (this._element) { this.destroyJoystick(); } } }, { key: 'createJoystick', - value: function createJoystick(props) { + value: function createJoystick() { var options = _extends({ zone: this._element - }, props.options); + }, this.props.options); if (this.props.static) { options.mode = 'static'; @@ -145,8 +145,8 @@ var ReactNipple = (_class = function (_Component) { this.joystick = joystick; - if (props.onCreated) { - props.onCreated(this.joystick); + if (this.props.onCreated) { + this.props.onCreated(this.joystick); } } }, { diff --git a/packages/react-nipple/src/ReactNipple.js b/packages/react-nipple/src/ReactNipple.js index 3771c1f..9343a8a 100644 --- a/packages/react-nipple/src/ReactNipple.js +++ b/packages/react-nipple/src/ReactNipple.js @@ -112,15 +112,15 @@ export default class ReactNipple extends Component { handleElement(ref) { this._element = ref; if (ref) { - this.createJoystick(this.props); + this.createJoystick(); } else if (this._element) { this.destroyJoystick(); } } - createJoystick(props) { + createJoystick() { const options = { zone: this._element, - ...props.options + ...this.props.options }; if (this.props.static) { @@ -143,8 +143,8 @@ export default class ReactNipple extends Component { this.joystick = joystick; - if (props.onCreated) { - props.onCreated(this.joystick); + if (this.props.onCreated) { + this.props.onCreated(this.joystick); } } destroyJoystick() { From 595605c2f384af95258867e5d72a00c1eea6a8cf Mon Sep 17 00:00:00 2001 From: Julien Usson Date: Tue, 31 Mar 2020 15:46:07 +0200 Subject: [PATCH 2/2] :bookmark: 1.0.3 --- packages/react-nipple/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-nipple/package.json b/packages/react-nipple/package.json index 272d5c3..d94bd56 100644 --- a/packages/react-nipple/package.json +++ b/packages/react-nipple/package.json @@ -1,6 +1,6 @@ { "name": "react-nipple", - "version": "1.0.2", + "version": "1.0.3", "main": "lib/index.js", "license": "MIT", "scripts": {