Skip to content

Commit 1820ee2

Browse files
authored
Merge pull request #15 from JulienUsson/bugfix/props-is-undefined-on-props-change
Bugfix/props is undefined on props change
2 parents 8d703a7 + 595605c commit 1820ee2

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

packages/react-nipple/lib/ReactNipple.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ var ReactNipple = (_class = function (_Component) {
113113
value: function handleElement(ref) {
114114
this._element = ref;
115115
if (ref) {
116-
this.createJoystick(this.props);
116+
this.createJoystick();
117117
} else if (this._element) {
118118
this.destroyJoystick();
119119
}
120120
}
121121
}, {
122122
key: 'createJoystick',
123-
value: function createJoystick(props) {
123+
value: function createJoystick() {
124124
var options = _extends({
125125
zone: this._element
126-
}, props.options);
126+
}, this.props.options);
127127

128128
if (this.props.static) {
129129
options.mode = 'static';
@@ -145,8 +145,8 @@ var ReactNipple = (_class = function (_Component) {
145145

146146
this.joystick = joystick;
147147

148-
if (props.onCreated) {
149-
props.onCreated(this.joystick);
148+
if (this.props.onCreated) {
149+
this.props.onCreated(this.joystick);
150150
}
151151
}
152152
}, {

packages/react-nipple/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-nipple",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"main": "lib/index.js",
55
"license": "MIT",
66
"scripts": {

packages/react-nipple/src/ReactNipple.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ export default class ReactNipple extends Component {
116116
handleElement(ref) {
117117
this._element = ref;
118118
if (ref) {
119-
this.createJoystick(this.props);
119+
this.createJoystick();
120120
} else if (this._element) {
121121
this.destroyJoystick();
122122
}
123123
}
124-
createJoystick(props) {
124+
createJoystick() {
125125
const options = {
126126
zone: this._element,
127-
...props.options
127+
...this.props.options
128128
};
129129

130130
if (this.props.static) {
@@ -147,8 +147,8 @@ export default class ReactNipple extends Component {
147147

148148
this.joystick = joystick;
149149

150-
if (props.onCreated) {
151-
props.onCreated(this.joystick);
150+
if (this.props.onCreated) {
151+
this.props.onCreated(this.joystick);
152152
}
153153
}
154154
destroyJoystick() {

0 commit comments

Comments
 (0)