Skip to content

Instantly share code, notes, and snippets.

@coryhouse
Last active March 1, 2016 16:03
Show Gist options
  • Save coryhouse/892da48761f73630f44b to your computer and use it in GitHub Desktop.
Save coryhouse/892da48761f73630f44b to your computer and use it in GitHub Desktop.
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