Check out example codes for "contenteditable onchange". It will help you in understanding the concepts better.

Code Example 1

<!-- Use an "input" event listener -->
<div contenteditable="true" id="editor">Please type something in here</div>
<script>
  document.getElementById("editor").addEventListener("input", inputEvt => {
    console.log("input event fired");
  }, false);
</script>

Learn ReactJs, React Native from akashmittal.com