Skip to content

Instantly share code, notes, and snippets.

@chvanikoff
Created January 14, 2016 22:24
Show Gist options
  • Save chvanikoff/c09dab878ac7684ceefa to your computer and use it in GitHub Desktop.
Save chvanikoff/c09dab878ac7684ceefa to your computer and use it in GitHub Desktop.
export default class Job extends React.Component {
constructor(props) {
super(props);
this.state = {
show: true
};
}
render() {
const job = this.props.job;
return <div onClick={this.switchShow.bind(this)}>
<h2>{job.title}</h2>
{if (this.state.show) {
<p>{job.text}</p>
<p>{job.details}</p>
}}
</div>;
}
switchShow() {
this.setState({show: !this.state.show});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment