Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created November 11, 2018 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/98fd1077e69c85c0062854e269fec886 to your computer and use it in GitHub Desktop.
Save productioncoder/98fd1077e69c85c0062854e269fec886 to your computer and use it in GitHub Desktop.
Youtube in React: dynamic subscriber button text
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