Last active
October 8, 2017 21:29
-
-
Save cbroberg/e9c611a5d5d00a5c33274d3e7cfe79cb to your computer and use it in GitHub Desktop.
Render Props and Ensuring Referential Identity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MouseMover extends Component { | |
renderMouseMovement = ({ x, y }) => { | |
return <Text>The mouse position is ({x}, {y})</Text> | |
} | |
render() { | |
return ( | |
<MouseMove render={this.renderMouseMovement} /> | |
) | |
} | |
} | |
// and calling the MouseMover somwhere later: | |
... | |
<MouseMover /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment