Skip to content

Conversation

@rolandjlevy
Copy link

@rolandjlevy rolandjlevy commented Oct 23, 2018

Will create Readme file shortly...

By the way, I struggled with the incQuantity function in MenuItem.js.

Originally I was incrementing the quantity of each item using state but when I wanted to reset the value to zero I got stuck because I couldn't use setState inside render. My workaround involves accessing the input element from the button element. The code looks kind of ridiculous:

const inputValue = Number(event.currentTarget.parentNode.parentNode.parentNode.parentNode.quantity.value)

Is there a better way of updating the input value from the button element?

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.

1 participant