You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still in the <Search /> component, add a onSubmit handler to the <form> tag. When the form is submitted (try clicking the search button), get the value of the state searchInput and pass it as a parameter to the search prop function that has been provided for you (the search prop is passed from the <Bookings /> component).
Note: Your submit handler should take an event parameter and add the line event.preventDefault() to prevent the browser from implicitly submitting the form
Test:
Given a searchInput field with input values entered
When the form is submitted
Then the value of searchInput is passed as a parameter to search
The text was updated successfully, but these errors were encountered:
From React-Module-Project created by SallyMcGrath: CodeYourFuture#18
18. Triggering search when submitting the form
Depends on #17
Instructions:
Still in the
<Search />
component, add aonSubmit
handler to the<form>
tag. When the form is submitted (try clicking the search button), get the value of the statesearchInput
and pass it as a parameter to thesearch
prop function that has been provided for you (thesearch
prop is passed from the<Bookings />
component).Note: Your submit handler should take an
event
parameter and add the lineevent.preventDefault()
to prevent the browser from implicitly submitting the formTest:
Given a searchInput field with input values entered
When the form is submitted
Then the value of searchInput is passed as a parameter to search
The text was updated successfully, but these errors were encountered: