Skip to content

Instantly share code, notes, and snippets.

@Jahans3
Last active July 17, 2017 18:48
Embed
What would you like to do?
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