S
S
Snelsi2019-08-29 22:11:54
JavaScript
Snelsi, 2019-08-29 22:11:54

How to properly decorate text in an input field using React hooks?

Let's say we have a design for an input field like this.
5d681dbaab87c419510255.png
Normally, we would just use input value with the useState hook:

let { value, setValue } = useState("");
const handleChange = (e) => { setValue(e.target.value);  }
<input value={value} onChange={handleChange} />

But in design, decorative spaces and a prefix are added to the value entered by the user. How to make such an input correctly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question