Skip to content

Conversation

@eggoweggo
Copy link

No description provided.

Copy link

@tgoslee tgoslee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job Shannon! Let me know if you have any questions on what I reviewed.

const [entries, setEntries] = useState(chatMessages);
const [likesTotal, setLikesTotal] = useState(0);

const changeLikes = (id) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.


const ChatEntry = (props) => {
const likedEntry = () => {
props.changeLikes(props.id)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job just passing the id and letting the code in App,js handle creating the object.

<TimeStamp time={props.timeStamp} />
</p>
<button onClick={likedEntry} className="like">
{props.liked ? '❤️':'🤍'}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great use of ternary

import ChatEntry from './ChatEntry';

const ChatLog = (props) => {
const chatEntryComponents = props.entries.map((entry) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you are getting an error about each entry having a unique key. Even though I see you using the entry id on line 9, I would suggest using the index from the map function

const ChatEntryComponents = props.entries.map((entry, index) => {
...
<ChatEntry
         key={index}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants