Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Last active May 14, 2019 10:54
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 koss-lebedev/941f098c612b62c49f65ee53e6f8a09b to your computer and use it in GitHub Desktop.
Save koss-lebedev/941f098c612b62c49f65ee53e6f8a09b to your computer and use it in GitHub Desktop.
import React, { FunctionComponent } from 'react'
type Props = {
posts: readonly RedditPost[]
subreddit: string
}
const Posts: FunctionComponent<Props> = ({ posts, subreddit }) => (
<div>
<h1>Posts in "{subreddit}"</h1>
<ul>
{posts.map(post => (
<li key={post.data.id}>{post.data.title}</li>
))}
</ul>
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment