Open raae opened 6 years ago
I do not like wesbos component name og single, should be photo.
From Wes Bos Video 13 I put this code up in github Client/Components/Single.js import React from 'react'; import Photo from './Photo'; // import Comments from './Comments';
const Single = React.createClass({ render() { const { postId } = this.props.params;
const i = this.props.posts.findIndex((post) => post.code === postId);
const post = this.props.posts[i];
console.log(i);
// const postComments = this.props.comments[postId] || [];
return (
<div className="single-photo">
<Photo i={i} post={post} {...this.props} />
</div>
)
} });
export default Single;
Created posts.js in https://github.com/lillylabs/react-redux-gram/Client/data/
Created:
App.js
Main.js
Photo.js
PhotoGrid.js
From Wes Bos video Used wesbos component name of "Single", did not change to "photo"
Part of #1