-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sea Turtles Natalia Woodson #90
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
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.
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) => { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this added feature!
No description provided.