I have a function onChange , where I write down what I put in the input in the state
onChange = id => currentValue => { this.setState(prevState => ({ data: { ...prevState.data, [id]: currentValue } })); }; but there is a situation when first a space or several spaces are entered into the input. I need to ignore the spaces in the beginning and remove them. At the same time, so that this behavior is displayed on the onChange . That is, they made a focus on the input, entered several spaces, began to write, for example, an email and the cursor at that moment left at the beginning, as if there were no spaces