-
Notifications
You must be signed in to change notification settings - Fork 45
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
Katherine Litter Patrol #45
base: master
Are you sure you want to change the base?
Conversation
Litter PatrolWhat We're Looking For
|
@@ -2,6 +2,7 @@ import React, { Component } from 'react'; | |||
import uuid from 'uuid'; | |||
import './App.css'; | |||
import GameItem from './components/GameItem.js'; | |||
import ItemIcons from './ItemIcons.js'; |
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 don't seem to be using this here.
|
||
GameItem.propTypes = { | ||
GameItem.propTypes = { //props come from parent | ||
itemType: PropTypes.string.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.
shouldn't the callback be included here
layer={100 + i} // Layer - used for a CSS style to show items on-top of bg | ||
layer={100 + i} | ||
itemType={item.type} //prop for GameItem | ||
onItemClick={this.handleItemClick}// |
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.
It might be a good idea to name this with the term callback, just for readability.
Litter Patrol
Congratulations! You're submitting your assignment!
Comprehension Questions
this.state
connected?CS Fundamentals Questions
App.render
(it starts withthis.state.items.map
). What is the Big-O time complexity of this code, where n is the number of active game items?setState
-- it must re-render all of the components that now have different content because of that change.What kind of data structure are the components in, and what sort of algorithms would be appropriate for React's code to "traverse" those components?
Speculate wildly about what the Big-O time complexity of that code might be.