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

Val - Edges - Litter Patrol #35

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

Conversation

valgidzi
Copy link

@valgidzi valgidzi commented Nov 30, 2018

Litter Patrol

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How are events / event handlers and this.state connected? In events and event handlers, this.state is used to set or access the state object in a component.
What are two ways to do "dynamic styling" with React? When should they be used? An example of dynamic styling is having a conditional that determines what CSS class to assign to an HTML element.
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 event handlers that use setState are triggered, the components are re-rendered. The virtual DOM is compared to the actual DOM to determine what needs to be re-rendered.
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? React functional components are more similar to Rails views than React state components. Rails views should only have presentation logic, which is mostly what functional components do, and React state components have state.
What was a challenge you were able to overcome on this assignment? Understanding event handlers in React better, reading React code.

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? O(n)
What part of React might benefit most from the use of specific data structure and algorithms? A data file being loaded into the app.
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.
I think the components are in a hash-like structure, so algorithms that work well with hashes might work well here. I think accessing items in hashes has time complexity O(n).

@tildeee
Copy link

tildeee commented Dec 18, 2018

Litter Patrol

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene x
Comprehension questions x
Functionality
Clicking on litter or nature shows a check or X respectively x
Clicking on litter appropriately updates the score x
Under the Hood
JavaScript is well-organized and easy to read x
Functions are named appropriately x
Callback functions are passed to components appropriately x
Overall

Val, great job on this!

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