-
Notifications
You must be signed in to change notification settings - Fork 35
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
weekend react cinema #19
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
componentDidMount(){ |
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.
method is not in use and can be removed
|
||
receivePaginationQuery(){ | ||
this.setState({ | ||
pageNumber: ++this.state.pageNumber |
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.
Calling ++ mutates state. It would be better to use this.state.pageNumber + 1 to increment value
constructor(){ | ||
super(); | ||
|
||
this.state = { |
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.
it looks like this is not in use and can be removed
}) | ||
let searchEntry = event.target.value | ||
if (searchEntry.length > 2){ | ||
handleSubmit(event) |
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.
you are passing a change event into a submit event handler which might make things go funny. It would be better to split out functionality you want to share between two event handlers into own function and call that from both event handlers
console.log(body) | ||
this.setState({ | ||
modalDetails: body, | ||
modalClass: "modal2" |
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.
it would be better to make this property a boolean and set the actual class name in render method. the reason for that is that if you wanted to change the class name in future, you would need to do it in mutiple places. if you set the class name in render depending on the state of the boolean, you would only need to change it in one place
No description provided.