Skip to content

Conversation

@NataliaWoodson
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 Natalia. I added some feedback to get your console errors in learn to go away. Let me know if you have any questions.

const [localTextColor, setLocalTextColor] = useState('black');
const [remoteTextColor, setRemoteTextColor] = useState('black');

const updateChatData = (updatedEntry) => {
Copy link

Choose a reason for hiding this comment

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

👍🏽

Comment on lines +42 to +47
id: PropTypes.number.isRequired,
sender: PropTypes.string,
body: PropTypes.string,
timestamp: PropTypes.string,
liked: PropTypes.bool,
onUpdate: 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, we are seeing errors for some of your propTypes. I would only use isRequired on the props that must be passed for the component to render to pass the tests. In this case, the only required props would be the sender, body, timeStamp props.

import PropTypes from 'prop-types';

const ChatLog = (props) => {
const chatEntries = 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.

you can use index with map. This should get rid of your key on each child error.

const chatEntries = prop.entries.map((entry, i) => 
...
<ChatEntry
     key={i}


ChatLog.propTypes = {
entries: PropTypes.array.isRequired,
onUpdateChat: 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.

onUpdateChat is also giving a console error in learn. If you want this prop to be required then you could update the test to make sure it covers this prop as well or you can make it not required.

import React from 'react';
import PropTypes from 'prop-types';

const ColorChoice = (props) => {
Copy link

Choose a reason for hiding this comment

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

Love this added feature!

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