Open
Conversation
added 21 commits
April 22, 2020 16:53
…putChange event handler, simplifies return function
…orm data to a string for RecentSubmission
…ner not added to button yet
… button is clicked
…s converting it into a line of poetry, rather than Game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignment Submission: Exquisite React
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
useStateandsetStatehooks to define an initial state and change the state, respectively.PlayerSubmissionForm,RecentSubmission, andFinalPoemare siblings, which are all nested in the parent componentGame.Gameand its children components are nested inApp.FinalPoemin the correct format on new lines and how to hide thePlayerSubmissionFormandRecentSubmissioncomponents when the final poem is revealed. I also didn't need to devise a helper function to get a new key for each element pushed tonewSubmissionList, becauseplayeralready increments on each form submission and is therefore unique.PlayerSubmissionFormevent handlers are similar, as well as the callback function that's called on each form submission. The concepts of passing data from Game to its child components as well as using dynamic styling are also similar.