Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube in React: event handlers for form
/* ... */
export class HeaderNav extends React.Component {
/* ... */
onInputChange = (event) => {
this.setState({
query: event.target.value,
});
};
onSubmit = () => {
const escapedSearchQuery = encodeURI(this.state.query);
this.props.history.push(`/search?search_query=${escapedSearchQuery}`);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.