Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Youtube in React: make single comment dynamic
export function Comment(props) {
if (!props.comment) {
return <div/>;
const topLevelComment = props.comment.snippet.topLevelComment;
const {authorProfileImageUrl, authorDisplayName, textOriginal} = topLevelComment.snippet;
const likeCount = topLevelComment.snippet.likeCount;
return (
<div className='comment'>
<Image className='user-image' src={authorProfileImageUrl} circular />
<div className='user-name'>{authorDisplayName}</div>
<div className='comment-actions'>
<Rating likeCount={likeCount}/> <Button size='mini' compact>REPLY</Button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment