Created
August 1, 2018 19:50
-
-
Save gonzalolarrosa/6fffdcfef4a0aa1644ccadcd35eab662 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
import React, { Component } from 'react'; | |
import './main-component.css'; | |
import ChildComponent from './ChildComponent'; | |
export default class MainComponent extends Component { | |
constructor (props) { | |
super(props); | |
this.label = “I’m your father”; | |
}; | |
onSubmit = (option) => (option === “I’m your father” ? ‘cool’ : ‘not cool’); | |
render () { | |
return( | |
<div className="container"> | |
<ChildComponent label={this.label} onSubmit={this.onSubmit} /> | |
</div> | |
); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment