Guest User

inputGmaps.js

a guest
Jun 14th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { PropTypes, Component } from 'react'
  2.  
  3. class InputGmaps extends Component {
  4.  
  5.     constructor(props) {
  6.         super(props);
  7.         console.log('gmaps');
  8.     }
  9.  
  10.     onChange = (event) => {
  11.         console.log(event.target.value);
  12.     }
  13.  
  14.     static propTypes = {
  15.         type: PropTypes.string,
  16.         onChange: PropTypes.func,
  17.         name: PropTypes.string,
  18.         value: PropTypes.string,
  19.         placeholder: PropTypes.string,
  20.         size: PropTypes.string
  21.     };
  22.  
  23.     static defaultProps = {
  24.         type: "text",
  25.         onChange: "exec",
  26.         name: "name",
  27.         placeholder: "Placeholder",
  28.         value: null,
  29.         size:"big"
  30.     };
  31.  
  32.     render() {
  33.  
  34.         return (
  35.             <input
  36.                 id={'autocomplete'}
  37.                 type={this.props.type}
  38.                 name={this.props.name}
  39.                 placeholder={this.props.placeholder}
  40.                 value={this.props.value}
  41.                 onChange={this.onChange}
  42.                 className={'inputGmaps-'+this.props.size}
  43.                 />
  44.         )
  45.     }
  46. }
  47.  
  48. export default InputGmaps
Advertisement
Add Comment
Please, Sign In to add comment