import React, {Component, PropTypes} from 'react' import DebouncingInput from './base/DebouncingInput'; import Dropdown from './base/Dropdown'; import {METHODS} from '../constants/global'; class UrlInput extends Component { shouldComponentUpdate (nextProps) { return this.props.request !== nextProps.request; } render () { const {sendRequest, onUrlChange, onMethodChange, request} = this.props; return (
{e.preventDefault(); sendRequest(request)}}>
) } } UrlInput.propTypes = { sendRequest: PropTypes.func.isRequired, onUrlChange: PropTypes.func.isRequired, onMethodChange: PropTypes.func.isRequired, request: PropTypes.shape({ url: PropTypes.string.isRequired, method: PropTypes.string.isRequired }).isRequired }; export default UrlInput;