Skip to content

Instantly share code, notes, and snippets.

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