Skip to content
Snippets Groups Projects
Input.js 492 B
Newer Older
  • Learn to ignore specific revisions
  • import PropTypes from "prop-types";
    
    function Input({ type, value, onChange, placeholder }) {
        return (
    
    Min Dong Hyeun's avatar
    Min Dong Hyeun committed
            <input
    
                type={type}
                placeholder={placeholder}
                onChange={onChange}
                value={value}
    
    Input.propTypes = {
        type: PropTypes.string.isRequired,
        value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
        onChange: PropTypes.func.isRequired,
        placeholder: PropTypes.string,
    }
    
    
    Min Dong Hyeun's avatar
    Min Dong Hyeun committed
    export default Input;