Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube in React: properly formatting video description
import Linkify from 'react-linkify';
getDescriptionParagraphs() {
const videoDescription = this.props.video.snippet ? this.props.video.snippet.description : null;
if (!videoDescription) {
return null;
}
return videoDescription.split('\n').map((paragraph, index) => <p key={index}><Linkify>{paragraph}</Linkify></p>);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.