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