const [firstName, setFirstName] = useState(null)
useEffect(() => {
if (props.profile && props.profile.profile) {
setFirstName(props.profile.first_name)
}
})
return (
<div>
<CustomTextField
className={classes.InputField}
variant="outlined"
name="firstname"
type="text"
fullWidth
placeholder=""
onChange={e => setFirstName(e.target.value)}
value={firstName}
/>
</div>
)
Here i am using react hooks state
Here, I am trying to change the default value which coming from api. But, I am not able to change on onChange method .
Please take a look how can i handle this .
Or any other way to handle this problem
Thanks