Created
January 18, 2018 10:10
-
-
Save awinogradov/601b4d2446d20e3293f3ac8ad355b3cc 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
export default class Stars extends Component { | |
async componentDidMount() { | |
let stars = await githubStars(this.props.repo); | |
this.setState({ stars }); | |
} | |
render({ repo }, { stars=0 }) { | |
let url = `//github.com/${repo}`; | |
return ( | |
<a href={url} class="stars"> | |
⭐️ {stars} Stars | |
</a> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment