Last active
July 17, 2017 18:48
-
-
Save Jahans3/a2e191d7a9b5d84a5f82ca96c38066f2 to your computer and use it in GitHub Desktop.
This file contains 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 MyContainer extends Component { | |
state = { | |
itemA: 'something', | |
itemB: 'another thing' | |
} | |
_onPress = () => { | |
// ... | |
} | |
_onPinch = () => { | |
// ... | |
} | |
_generateProps = () => ({ | |
...this.props, | |
...this.state, | |
onPress: this._onPress, | |
onPinch: this._onPinch | |
}) | |
render () { | |
const props = this._generateProps() | |
return ( | |
<MyComponent {...props} /> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment