Skip to content

Instantly share code, notes, and snippets.

@idmontie
Created April 8, 2018 02:29
Show Gist options
  • Save idmontie/0641b982e9ba06f28febde359a0f1ebc to your computer and use it in GitHub Desktop.
Save idmontie/0641b982e9ba06f28febde359a0f1ebc to your computer and use it in GitHub Desktop.
const mousePosition = () => (BaseComponent) => {
return class MousePosition extends Component {
// ...
render() {
const { x, y } = this.state;
return <BaseComponent {...this.props} x={x} y={y} />;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment