There is an input form (of type file):
<input
name="image"
id="image-input"
accept="image/*"
onChange={this.uploadFile}
multiple
type="file"
className="imgInp"
/>
How can it be added a text on it? I don't want it outside of the input, in that case I would add a span like: <span> Upload image </span>
but I want the text to be on the input.
On this page, it says that there is an attribute value
that must be added but if I add it inside the input it throws this error:
InvalidStateError: Failed to set the 'value' property on
'HTMLInputElement': This input element accepts a filename, which may
only be programmatically set to the empty string.
<input
name="image"
id="image-input"
accept="image/*"
onChange={this.uploadFile}
multiple
type="file"
className="imgInp"
value="Upload image" //this is where value was added
/>
Is there a way to make this work?