Check out example codes for "move cursor to end of line javascript". It will help you in understanding the concepts better.

Code Example 1

<input type="text" id="yourId" onfocus=" let value = this.value; this.value = null; this.value=value" name="nameYouWant" class="yourClass" value="yourValue" placeholder="yourPlaceholder...">
<script>
    document.getElementById("yourId").focus()
</script>

Learn ReactJs, React Native from akashmittal.com