Skip to content

Instantly share code, notes, and snippets.

@idmontie
Last active April 7, 2018 02:31
Show Gist options
  • Save idmontie/9025baa410b03663eed9afc8106d4d6d to your computer and use it in GitHub Desktop.
Save idmontie/9025baa410b03663eed9afc8106d4d6d to your computer and use it in GitHub Desktop.
class App extends Component {
render() {
return (
<MousePosition>
{({ x, y }) => (
<Tween func={linear} defaultStart={centerX} end={x}>
{({ current: cx }) => (
<Tween func={linear} defaultStart={centerY} end={y}>
{({ current: cy }) => (
<Rectangle x={cx} y={cy} />
)}
</Tween>
)}
</Tween>
)}
</MousePosition>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment