Conversation
tgoslee
left a comment
There was a problem hiding this comment.
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) => { |
| id: PropTypes.number.isRequired, | ||
| sender: PropTypes.string, | ||
| body: PropTypes.string, | ||
| timestamp: PropTypes.string, | ||
| liked: PropTypes.bool, | ||
| onUpdate: PropTypes.func.isRequired, |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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) => { |
No description provided.