Skip to content
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

Laura | Nodes #28

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

lauracodecreations
Copy link

Litter Patrol

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How are events / event handlers and this.state connected? The events can change the state of the object
What are two ways to do "dynamic styling" with React? When should they be used? Using the className to add classes to the object based on actions made by the user.
Much like Rails works with the HTTP request->response cycle, React works with the browser's input->output cycle. Describe React's cycle from receiving user input to outputting different page content. When an user clicks on an object, React receives user input through the browser and this input updates the virtual app. Then, the VDOM updates the DOM, and the DOM renders itself to the Browser.

Compare how React and Rails' views differ. Given different circumstances, these systems have different goals. How does this impact on their design and how we are supposed to use them? |
What was a challenge you were able to overcome on this assignment? | It was challenging understanding the code at the beginning, specifically how ItemIcons was being called and used in the program.

CS Fundamentals Questions

Question Answer
Consider the code on the first few lines of App.render (it starts with this.state.items.map). What is the Big-O time complexity of this code, where n is the number of active game items? linear because you are looping
What part of React might benefit most from the use of specific data structure and algorithms? When we are building higher level objects. When we want to render, we want to have a very efficient algorithm.

Consider what happens when React processes a state change from 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. | It comes in as a tree data structure because the DOM's structure is a tree. A homemade algorithm is used to transverse the tree in Reach: The Diffing Algorithm. The Big-O of that code is linear because it has to check through all the components (all the nodes are visited).

@CheezItMan
Copy link

Litter Patrol

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene Good number of commits and good commit messages
Comprehension questions Try to avoid breaking the markdown table. What was the other way to do dynamic styling? Good comments on the CS fun questions.
Functionality
Clicking on litter or nature shows a check or X respectively Check
Clicking on litter appropriately updates the score Check
Under the Hood
JavaScript is well-organized and easy to read Check
Functions are named appropriately Check
Callback functions are passed to components appropriately Check
Overall Well done, you hit all the learning goals for the project. I had one minor comment about missing proptypes, but otherwise excellent work!

</div>
);
}
}


GameItem.propTypes = {
height: PropTypes.number.isRequired,

Choose a reason for hiding this comment

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

Shouldn't type and the callback be in proptypes?

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