Created
August 3, 2017 11:25
-
-
Save pokorson/f94f76c2800364f998a5f18e2f1087b5 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
class ParentComponent extends React.Component { | |
handleChange(val) { | |
this.setState({val: val}) | |
} | |
render() { | |
<Select onChange={handleChange} /> | |
} | |
} | |
class Select extends React.Component { | |
handleClick() { | |
this.props.onChange(this.state.value); | |
} | |
render() { | |
<div> | |
<span onClick={this.handleClick}></span> | |
<span></span> | |
<span></span> | |
</div> | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment