Skip to content

Commit 742b583

Browse files
author
Rizchel Dayao
committed
Fix bug when undefined shows on button click
1 parent 6d30325 commit 742b583

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/containers/InputSet.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class InputSet extends Component {
3232
}
3333

3434
// Function for when 'search' is clicked and retrieves movies
35-
handleResponse(input) {
35+
handleResponse() {
36+
const { input } = this.state;
3637
const { retrieveMovies } = this.props;
3738
retrieveMovies(input);
3839
}
@@ -44,9 +45,8 @@ class InputSet extends Component {
4445

4546
// Function for 'enter' key press
4647
handleKeyPress(target) {
47-
const { input } = this.state;
4848
if(target.charCode===13){
49-
this.handleResponse(input);
49+
this.handleResponse();
5050
}
5151
}
5252

0 commit comments

Comments
 (0)