Created
November 11, 2018 21:33
-
-
Save productioncoder/98fd1077e69c85c0062854e269fec886 to your computer and use it in GitHub Desktop.
Youtube in React: dynamic subscriber button text
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
getSubscriberButtonText() { | |
const {channel} = this.props; | |
const parsedSubscriberCount = Number(channel.statistics.subscriberCount); | |
const subscriberCount = getShortNumberString(parsedSubscriberCount); | |
return `Subscribe ${subscriberCount}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment