Last active
September 22, 2016 11:22
-
-
Save 0xF013/5c8c420b7ba7742dfc5520e1d7f1280e to your computer and use it in GitHub Desktop.
This file contains hidden or 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, etc | |
import { beginRegistration } from 'actions/registration'; | |
export RegistrationButton extends Component { | |
propTypes = { | |
text: PropTypes.string.isRequired, | |
beginRegistration: PropTypes.func.isRequired | |
}; | |
render() { | |
const { text, beginRegistration } = this.props; | |
return (<button onClick={beginRegistration}>{text}</button>); | |
} | |
} | |
const mapStateToProps = state => ({text: state.registrationText }); | |
const mapDispatchToProps = dispatch => ({ | |
beginRegistration() { | |
dispatch(beginRegistration()); | |
} | |
}); | |
export default connect(mapStateToProps, mapDispatchToProps)(RegistrationButton); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment