Skip to content

Instantly share code, notes, and snippets.

@oshell
Created December 8, 2018 14:54
Show Gist options
  • Select an option

  • Save oshell/1a00f9d93e9817ecd3c48174c0751dd1 to your computer and use it in GitHub Desktop.

Select an option

Save oshell/1a00f9d93e9817ecd3c48174c0751dd1 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { Input as SemanticInput } from 'semantic-ui-react';
import { connect } from 'react-redux';
import { search } from '../../actions/index';
class Input extends Component {
render() {
return(
<SemanticInput
onChange={(e) => {this.props.search(e.target.value);}}
placeholder='Search...' />
);
}
}
const mapStateToProps = state => ({});
const mapDispatchToProps = {
search
};
export default connect(mapStateToProps, mapDispatchToProps)(Input);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment