i have a component like that. I also use useState hook in that component and my react project in version 17.0.2. But in the console dev tool apparent "Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function " .Can u help me, pls
import { useState } from 'react'
function AddProduct () {
const [product , setProduct] = useState(1)
const handleChange = (e) => {
setProduct(e.target.value)
}
return (
<div>
<input value={product} onChange={handleChange}/>
<button>Save</button>
</div>
)
}
export default AddProduct