Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active March 30, 2020 17:04
Show Gist options
  • Save akexorcist/ac1b2ec4fc3d51140cd37f36cc43e670 to your computer and use it in GitHub Desktop.
Save akexorcist/ac1b2ec4fc3d51140cd37f36cc43e670 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react'
...
class ChildComponent extends Component {
...
onConfirmClick = () => {
const order = ...
this.props.confirm(order)
}
render() {
return (
<React.Fragment>
...
<button onClick={this.onConfirmClick}>Confirm</button>
</React.Fragment>
)
}
}
export default ChildComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment