Created
September 5, 2018 07:18
-
-
Save codingnninja/83ca2b2456e16463c1b1672aaad48702 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
const e = React.createElement; | |
class FollowButton extends React.Component { | |
constructor(props) { | |
super(pros); | |
this.state = { follow: false }; | |
} | |
render() { | |
if (this.state.follow) { | |
return 'You are following this.'; | |
} | |
//create like button | |
return e( | |
'button', | |
{ onClick: () => this.setState({ follow: true }) }, | |
'Follow' | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment