I am trying to get the input value type of number. But the value keep showing me its a type of string. How do i fix this?
const [price, setPrice] = useState();
const handlePrice = (event) => {
console.log(event.target.value);
setPrice(event.target.value);
};
<div className="col-md-6">
<label for="inputPrice" className="form-label">
Price
</label>
<input
value={price}
onChange={handlePrice}
type="number"
className="form-control"
id="inputPrice"
/>
</div>
<div className="col-12">