Skip to content

Instantly share code, notes, and snippets.

@astrotim astrotim/Home.js.diff
Last active Dec 29, 2017

Embed
What would you like to do?
added React Router's Link
import React from 'react';
+import { Link } from 'react-router-dom';
import { createClient } from 'contentful';
class Home extends React.Component {
return this.state.posts.map(post => {
console.log(post);
- return <p>Post</p>;
+ return (
+ <Link key={post.sys.id} to={`post/${post.sys.id}/`}>
+ {post.fields.title}
+ </Link>
+ );
});
}
}
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.