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

Water - Iris #45

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

Water - Iris #45

wants to merge 5 commits into from

Conversation

iris-lux
Copy link

@iris-lux iris-lux commented Jan 8, 2021

Assignment Submission: Exquisite React

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

Reflection

Prompt Response
Define in your own words: What does "state" in React mean? How do we use it? State represents the parts of the app which can change. We can use state with the useState function.
Describe the relationships between the components on a high-level: which components were siblings? Which components were nested within each other? PlayerSubmissionForm, RecentSubmission, FinalPoem are sibilings. Game is their parent.
How did this project differ from in-class examples? We had conditional event handlers.
How was this project similar to in-class examples? We used useState to keep track of state.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Overall not bad Iris, you had things mostly working. See my comments on the Game.js file. Some of the tests are failing because your props are different than the ones the tests were using. They make assumptions about your code that is different. You also have one bug I've identified so you're missing a field. That's why some of the other tests are failing.

Other than that you have a fully functional Exquisite Corpse game. Nice work. You did demonstrate the skills we were assessing.

import PropTypes from 'prop-types';
import './FinalPoem.css';

const FinalPoem = (props) => {

const [finalSentence, setFinalSentence] = useState('')

Choose a reason for hiding this comment

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

Does finalSentence need to be in state? Could props work just as well?

Also the tests make some assuptions about the props that you've chanced, which is why they don't pass.

@@ -13,6 +16,23 @@ const Game = () => {
}
}).join(' ');

const addSentence = (formFields) => {
const newSentences = [...sentences]
newSentences.push(`The ${formFields.adj1} ${formFields.noun1} ${formFields.adverb} ${formFields.verb} the ${formFields.adj2} ${formFields.noun2}`)

Choose a reason for hiding this comment

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

The adverb here is not getting pushed into the sentence.

Suggested change
newSentences.push(`The ${formFields.adj1} ${formFields.noun1} ${formFields.adverb} ${formFields.verb} the ${formFields.adj2} ${formFields.noun2}`)
newSentences.push(`The ${formFields.adj1} ${formFields.noun1} ${formFields.adv} ${formFields.verb} the ${formFields.adj2} ${formFields.noun2}`)

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