'losing focus on input field in react form
i am creating simple input field but whenever i type a letter it loses focus , why is it happening ?
<form onSubmit={(e) => submitPost(e)}>
<input
placeholder="Enter First Name"
type="text"
onChange={(e) => setFirstName(e.target.value)}
name="firstname"
value={firstName}
/>
<input
placeholder="Enter Last Name"
onChange={(e) => setlastName(e.target.value)}
type="text"
name="lastname"
value={lastName}
/>
</form>
if this information is not sufficient then i have file link below too -> https://codesandbox.io/s/compassionate-gauss-pq2wr?file=/src/App.js:1312-1574 there are some answers on google i can't quite follow them according to my code
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
