Last active
March 17, 2017 02:58
-
-
Save srossross/fb5ccb659988bb04d2b5dd4d4dc8d5eb 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
function mapStateToProps(state) { | |
return { | |
value: state.blackbox.value | |
} | |
} | |
function mapDispatchToPops(dispatch) { | |
return { | |
setLHS: () => null, // TBD | |
setRHS: () => null, // TBD | |
} | |
} | |
@ReactRedux.connect(mapStateToProps, mapDispatchToPops) | |
class MyComponent extends React.Component { | |
render() { | |
return (<div> | |
The value of the external component is | |
<span className="ripple"> {this.props.value} </span> | |
<br/> | |
<hr/> | |
<button className="ripple" onClick={this.props.setLHS}> | |
Set LHS to 2 | |
</button> | |
<br/> | |
<button className="ripple" onClick={this.props.setRHS}> | |
Set RHS to 99 | |
</button> | |
</div>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment