Skip to content

Conversation

@hopeolaide
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 Hope! Your app looks good and meets the requirements. I saw in learn that you were getting some console errors. I left some feedback on how to fix them. Let me know if you have any questions.

ChatLog.propTypes = {
//Fill with correct proptypes
entries: PropTypes.arrayOf(PropTypes.object).isRequired,
update: PropTypes.func.isRequired,
Copy link

Choose a reason for hiding this comment

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

In Learn, I'm sure that you saw a console error for the update prop. Because your update prop was not in the original project you can handle this error by making the update prop a required prop or you can update the tests to look for update as well as entries.

Comment on lines +42 to +45
sender: PropTypes.string.isRequired,
body: PropTypes.string.isRequired,
timeStamp: PropTypes.string.isRequired,
liked: PropTypes.bool.isRequired,
Copy link

Choose a reason for hiding this comment

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

Same here. The original prop types that the test is looking for are sender, body, and timeStamp. If you added your own you can either make them not required or update the test to account for the added prop types.

//Mapping each entry of chatMessages array to a chatEntry react component
return (
<ChatEntry
key={entry.id} /* //Look up react keyError */
Copy link

Choose a reason for hiding this comment

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

you could use the index from map as the key to see if it fixes the error

return entries.map((entry , i) => ...

<ChatEntry
   key={i}...

setUpdateChatLog(newChatData);
};

const likeCount = updateChatLog.reduce((total, entry) => {
Copy link

Choose a reason for hiding this comment

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

good use of reduce!

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