Guest User

Untitled

a guest
Nov 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. const GitRepositorySearch = () => {
  2. const INITITAL = 'react'
  3. const [search, setSearch] = useState(INITITAL)
  4.  
  5. return (
  6. <form onSubmit={evt => { evt.preventDefault(); setSearch(evt.target.search.value) }} >
  7. <input type='text' name='search' defaultValue={INITITAL} />
  8. <button type="submit">Submit</button>
  9. <GitRepositoryResults name={search}/>
  10. </form>
  11. )
  12. }
Add Comment
Please, Sign In to add comment