import React, {useState} from 'react';

const RangeInput = ({min, max}) => {
    const [val, setVal] = useState('')

    return (
        <div>
            <input type='number'
                   style={{color: val < min || val > max ? 'red' : 'black'}}
                   value={val}
                   onChange={(e) => setVal(e.target.value)}
            />
        </div>
    );
};

export default RangeInput;