-
Notifications
You must be signed in to change notification settings - Fork 3
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
Scoring feature #12
Scoring feature #12
Conversation
"build": "react-scripts --openssl-legacy-provider build", | ||
"test": "react-scripts --openssl-legacy-provider test", | ||
"eject": "react-scripts --openssl-legacy-provider eject" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will the need for --openssl-legacy-provider
go away if you switch from create-react-app
?
src/components/game/GameCard.js
Outdated
@@ -101,17 +109,14 @@ const CardBody = ({ article, nextButton }) => { | |||
onChange={changeHandler("reuters")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean onChange={() => changeHandler("reuters")}
what you have now invokes the change handler as soon as it executes that line of code.
The fact that you demoed it and this was working as is is a bit confusing to me...
edit: I see your changeHandler
returns an anonymous function, is there a particular reason for this that you discovered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for this one, I had already made a changeHandler that was trying to do two jobs, capturing the radio button change and comparing the sources, which should have been in the submitHandler. This was just how the refactor/separation of the two functions (changeHandler and handleSubmit) played out. But, really, the changeHandler function isn't really even needed, since an anonymous function would work on the onChange, like you mentioned.
I think in my previous edit to the changeHandler, it made sense at the time because I was passing it in 5 different times so it was an attempt to dry up the code. But now, I've got the RadioButtons rendering via a map, so won't be repeating that code anyway. Removing the changeHandler now makes a lot of sense.
@@ -40,6 +40,14 @@ const RadioButton = ({ label, value, onChange }) => { | |||
const CardBody = ({ article, nextButton }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd break this file into separate component files for better legibility.
Co-authored-by: Ivy Feraco <unjust@gmail.com>
… boolean, and other refactors. it was a refactor party
…into scoring-feature the commit. "merging the changes commits made from PR request"
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Related to but doesn't close #10