Last active
October 17, 2018 14:58
-
-
Save Natedeploys/d97ef41f3633710d48e421ff1acf0822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Packages, Components | |
import React, { Component } from "react"; | |
import SearchField from "../components/SearchField"; | |
class Search extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
keyword: "" | |
}; | |
} | |
handleKeyword = keyword => { | |
this.setState({ | |
keyword | |
}); | |
}; | |
handleFetch = () => { | |
// Your fetch code here, access keyword with this.state.keyword | |
// You can also pass it in as a parameter but its up to you | |
}; | |
render() { | |
return ( | |
<div> | |
<SearchField | |
keyword={this.state.keyword} | |
handleKeyword={this.handleKeyword} | |
handleFetch={this.handleFetch} | |
/> | |
</div> | |
); | |
} | |
} | |
export default Search; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment