-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
branch in development (uploading to check tests) #1920
base: master
Are you sure you want to change the base?
Conversation
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.
Great job, let's improve your code a bit more!
<NewMovie onAdd={(movie) => { | ||
addMovie(movie); | ||
}} |
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.
<NewMovie onAdd={(movie) => { | |
addMovie(movie); | |
}} | |
<NewMovie onAdd={addMovie} |
can be simplify
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.
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.
ok, let's leave it!
src/components/NewMovie/NewMovie.tsx
Outdated
}; | ||
|
||
const disabledCondition | ||
= titleValue === '' |
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.
= titleValue === '' | |
= !titleValue |
can be simplify, check please below also
}; | ||
|
||
const reset = () => { | ||
setCount(count + 1); |
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.
is this correct? when user click reset button the count is increase? i think should be initial value
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.
// Increase the count after successful form submission
// to reset touched status of all the Field
s
Yes, the comment in Master branch requests this to for reset
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.
Also, there is no reset button. Reset is done on the press of submit
to clear the fields, which also ticks up count to prevent error message from appearing.
onAdd(movie); | ||
reset(); |
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.
in this place when user click add button the count should be increase
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.
And it does in the Reset
function
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.
In the comment Above
The |
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.
Awesome job, i'm approving it🔥
DEMO LINK
Please be aware that this is an unfinished version. As the command 'npm test' always times out, I'm making this pull request to check tests and see what I need to improve. However, feel free to add feedback if you wish.
Update: Tests were successful!