This is my code:
<Input
onChange={(e) => someChange(e)}
valid={check.length !== 0}
invalid={check.length === 0}
type="text"
name="name"
id="name"
placeholder={something}
value={props.someProp ? props.user.name : ''}
/>
So what happens here is when I enter into props.someProp my value gets retrieved. The problem is that I cannot edit that field. Please note that user object gets populated when this screen appears.
How can I make some kind of sanity check so I still get the value populated, but I can edit it afterwards?
Thanks.
props- you'll have to store those withinstate. Also can you provide the code forsomeChangesomeChangedo? maybe if you inverse the logic likevalue={ props.user.name? '' : props.someProp}?someChangebasically getse.target.valueand stores it.