Last active
March 1, 2016 16:03
-
-
Save coryhouse/892da48761f73630f44b 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 from 'react'; | |
class HelloWorld extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
sayHi(event) { | |
alert(`Hi ${this.props.name}`); | |
} | |
render() { | |
return ( | |
<div> | |
<a href="#" onClick={this.sayHi.bind(this)}>Say Hi</a> | |
</div> | |
); | |
} | |
} | |
HelloWorld.propTypes = { | |
name: React.PropTypes.string.isRequired | |
}; | |
export default HelloWorld; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment