Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
change dep
  • Loading branch information
macrozone committed Oct 17, 2017
commit 26617f9db38e50e4bb9faecb7c5838a4e5c4d0b3
16 changes: 8 additions & 8 deletions components/ARSprite.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import withAnimationFrame from 'react-animation-frame';
import withAnimationFrame from '@panter/react-animation-frame';

import { NativeModules, Animated } from 'react-native';

Expand All @@ -13,7 +13,7 @@ const ARSprite = withAnimationFrame(
super(props);
this.state = {
zIndex: new Animated.Value(),
pos2D: new Animated.ValueXY(), // inits to zero
pos2D: new Animated.ValueXY() // inits to zero
};
}
onAnimationFrame() {
Expand All @@ -22,9 +22,9 @@ const ARSprite = withAnimationFrame(
{
x: this.state.pos2D.x,
y: this.state.pos2D.y,
z: this.state.zIndex,
},
]),
z: this.state.zIndex
}
])
);
}

Expand All @@ -34,18 +34,18 @@ const ARSprite = withAnimationFrame(
style={{
position: 'absolute',
transform: this.state.pos2D.getTranslateTransform(),
...this.props.style,
...this.props.style
}}
>
{this.props.children}
</Animated.View>
);
}
},
}
);

ARSprite.propTypes = {
position,
position
};

module.exports = ARSprite;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"lodash": "^4.17.4",
"prop-types": "^15.5.7",
"react": "16.0.0-alpha.12",
"react-animation-frame": "^0.3.5"
"@panter/react-animation-frame": "^0.3.6"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
Expand Down