Skip to content

Commit

Permalink
feat(state): add check for state changes based on unique searchQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
Valik3201 committed Jan 28, 2024
1 parent 8a7f291 commit 76a7d39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ class App extends Component {
};

handleSubmit = searchQuery => {
if (searchQuery === this.state.searchQuery) {
return;
}

this.setState({
searchQuery: searchQuery,
images: [],
Expand Down

0 comments on commit 76a7d39

Please sign in to comment.