diff --git a/src/App.js b/src/App.js index 4019db5..afd4610 100644 --- a/src/App.js +++ b/src/App.js @@ -28,7 +28,8 @@ class App extends React.Component { this.setState({search:value}) } - handleFilterCharacters = () => { + handleFilterCharacters = (e) => { + e.preventDefault() const { characters, search} = this.state; const filteredArray = characters.filter(({name})=> name.toUpperCase().includes(search.toUpperCase())) this.setState({filteredCharacters:filteredArray}) @@ -38,9 +39,9 @@ class App extends React.Component { const {filteredCharacters, isLoading} = this.state return (
-
+ - +
{ isLoading ? :