Skip to content

Conversation

@FreeMonkey19
Copy link

React Tic Tac Toe

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Prompt Response
How are events / event handlers and useState connected? Events are the act of something happening...click...mouseOver...submit...the list goes on. An event handler, listens for this event on the button or field and then useState is updated as events are taking place - at each render and useState keeps track of the state.
What are two ways to do "dynamic styling" with React? When should they be used? Inline styling or styling objects in the render function. Inline styles are ok if you just have a few styles to make. Otherwise, not recommended. Styling in the render function is good if you're using React Native.
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. 1. Component is created and inserted into DOM. 2. Then gets updated via state or props. 3. The component is removed from the DOM. And the 4th stage is errorHandling. https://blog.logrocket.com/the-new-react-lifecycle-methods-in-plain-approachable-language-61a2105859f3/

CS Fundamentals Questions

Question Answer
What do you think is the BigO complexity of the method you use to compute a winner?
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.
React implements a heuristic O(n) algorithm. https://reactjs.org/docs/reconciliation.html

@CheezItMan
Copy link

React Tic Tac Toe

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
Demonstrates proper JavaScript coding style. ✔️
Correctly passes props to child components. ✔️
Correctly passes callback functions to child components and calls them to respond to user events.) ✔️
Maintains the status of the game in state. ✔️
Practices git with at least 6 small commits and meaningful commit messages ✔️, Good number of commits, but instead of using waves for commit messages, you should describe the functionality added.
Uses existing stylesheets to render components ✔️

Functional Requirements

Functional Requirement yes/no
The Square component renders properly and executes the callback on a click event. ✔️
The Board component renders a collection of squares ✔️
The App component renders a board and uses state to maintain the status of the game. ✔️
Utilizes callbacks to UI events to update state ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 5+ in Code Review && 3+ in Functional Requirements

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Descriptive/Readable
Concise
Logical/Organized

Summary

Looks very good, you hit all the learning goals and even worked in useEffect as well. Nice work.

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