UNPKG

nyg-static-jam3

Version:

Jam3 frontend static project scaffold generator based on nyg

20 lines (18 loc) 425 B
import React from 'react'; import { withRouteData } from 'react-static'; import { Link } from 'react-router-dom'; export default withRouteData(({ posts }) => ( <div> <h1>It's blog time.</h1> <br /> All Posts: <ul> {posts && posts.map(post => ( <li key={post.id}> <Link to={`/blog/post/${post.id}/`}>{post.title}</Link> </li> ))} </ul> </div> ));